From d3e19fe879b73c3420c2e354746da974637ac80e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 1 Dec 2018 19:35:46 +0100 Subject: [PATCH] Update content/en/development/ --- content/en/development/ | 38 +++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/content/en/development/ b/content/en/development/ index 2f14e90..c38ddfc 100644 --- a/content/en/development/ +++ b/content/en/development/ @@ -25,9 +25,27 @@ The default value of `RAILS_ENV` is `development`, so you don't need to set anyt It should be noted that the Docker configuration distributed with Mastodon is optimized for the production environment, and so is an extremely bad fit for development. The Vagrant configuration, on the other hand, is meant specifically for development and not production use. +## Setup + +In the development environment, Mastodon will use PostgreSQL as the currently signed-in Linux user using the `ident` method, which usually works out of the box. The one command you need to run is `rails db:setup` which will create the databases `mastodon_development` and `mastodon_test`, load the schema into them, and then create seed data defined in `db/seed.rb` in `mastodon_development`. The only seed data is an admin account with the credentials `admin@localhost:3000` / `mastodonadmin`. + +> Please keep in mind, by default Mastodon will run on port 3000. If you configure a different port for it, the generated admin account will use that number. + +## Running + +There are multiple processes that need to be run for the full set of Mastodon's functionality, although they can be selectively omitted. To run all of them with just one command, you can install Foreman with `gem install foreman --no-ri --no-rdoc` and then use: + + foreman start + +In the Mastodon directory. This will start processes defined in ``, which will give you: A Rails server, a Webpack server, a streaming API server, and Sidekiq. Of course, you can run any of those things stand-alone depending on your needs. + ## Testing -To confirm that your Mastodon code works, run the automated test suite with `rspec` +|Command|Description| +|-------|-----------| +|`rspec`|Run the Ruby test suite| +|`yarn run test`|Run the JavaScript test suite| +|`rubocop`|Check the Ruby code for conformance with our code style| ## Most notable libraries used @@ -79,4 +97,20 @@ The following overview should not be seen as complete or authoritative, but as a |Path|Description| |----|-----------| |`app/javascript/images`|Images| -|`app/javascript/styles`|Code that turns into CSS via Sass| \ No newline at end of file +|`app/javascript/styles`|Code that turns into CSS via Sass| + +### Localizations + +|Path|Description| +|----|-----------| +|`config/locales`|Server-side localizations in the YML format| +|`app/javascript/mastodon/locales`|Client-side localizations in the JSON format| + +## Localization maintenance + +All locale files are normalized to ensure consistent formatting and key order, which minimizes changesets in version control. + +|Command|Description| +|-------|-----------| +|`i18n-tasks normalize`|Normalize server-side translations| +|`yarn run manage:translations`|Normalize client-side translations| \ No newline at end of file -- 2.17.1