Move translate documentation

This commit is contained in:
Nolway 2021-12-18 22:32:15 +01:00 committed by Alexis Faizeau
parent 41ef9fd49f
commit 31b92da6ce
2 changed files with 18 additions and 12 deletions

View File

@ -1,13 +1,13 @@
# Contributing to WorkAdventure # Contributing to WorkAdventure
Are you looking to help on WorkAdventure? Awesome, feel welcome and read the following sections in order to know how to Are you looking to help on WorkAdventure? Awesome, feel welcome and read the following sections in order to know how to
ask questions and how to work on something. ask questions and how to work on something.
## Contributions we are seeking ## Contributions we are seeking
We love to receive contributions from our community — you! We love to receive contributions from our community — you!
There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, There are many ways to contribute, from writing tutorials or blog posts, improving the documentation,
submitting bug reports and feature requests or writing code which can be incorporated into WorkAdventure itself. submitting bug reports and feature requests or writing code which can be incorporated into WorkAdventure itself.
## Contributing external resources ## Contributing external resources
@ -16,7 +16,7 @@ You can share your work on maps / articles / videos related to WorkAdventure on
## Developer documentation ## Developer documentation
Documentation targeted at developers can be found in the [`/docs/dev`](docs/dev/) Documentation targeted at developers can be found in the [`/docs/dev`](docs/dev/)
## Using the issue tracker ## Using the issue tracker
@ -34,11 +34,11 @@ Finally, you can come and talk to the WorkAdventure core team... on WorkAdventur
## Pull requests ## Pull requests
Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope
and avoid containing unrelated commits. and avoid containing unrelated commits.
Please ask first before embarking on any significant pull request (e.g. implementing features, refactoring code), Please ask first before embarking on any significant pull request (e.g. implementing features, refactoring code),
otherwise you risk spending a lot of time working on something that the project's developers might not want to merge otherwise you risk spending a lot of time working on something that the project's developers might not want to merge
into the project. into the project.
You can ask us on [Discord](https://discord.gg/YGtngdh9gt) or in the [GitHub issues](https://github.com/thecodingmachine/workadventure/issues). You can ask us on [Discord](https://discord.gg/YGtngdh9gt) or in the [GitHub issues](https://github.com/thecodingmachine/workadventure/issues).
@ -54,7 +54,7 @@ $ yarn install
$ yarn run prepare $ yarn run prepare
``` ```
If you don't have the precommit hook installed (or if you committed code before installing the precommit hook), you will need If you don't have the precommit hook installed (or if you committed code before installing the precommit hook), you will need
to run code linting manually: to run code linting manually:
```console ```console
@ -72,7 +72,7 @@ Nevertheless, if your code can be unit tested, please provide a unit test (we us
If you are providing a new feature, you should setup a test map in the `maps/tests` directory. The test map should contain If you are providing a new feature, you should setup a test map in the `maps/tests` directory. The test map should contain
some description text describing how to test the feature. some description text describing how to test the feature.
* if the features is meant to be manually tested, you should modify the `maps/tests/index.html` file to add a reference * if the features is meant to be manually tested, you should modify the `maps/tests/index.html` file to add a reference
to your newly created test map to your newly created test map
* if the features can be automatically tested, please provide a testcafe test * if the features can be automatically tested, please provide a testcafe test
@ -90,8 +90,8 @@ $ npm run test
``` ```
Note: If your tests fail on a Javascript error in "sockjs", this is due to the Note: If your tests fail on a Javascript error in "sockjs", this is due to the
Webpack live reload. The Webpack live reload feature is conflicting with testcafe. This is why we recommend starting Webpack live reload. The Webpack live reload feature is conflicting with testcafe. This is why we recommend starting
WorkAdventure with the `LIVE_RELOAD=0` environment variable. WorkAdventure with the `LIVE_RELOAD=0` environment variable.
End-to-end tests can take a while to run. To run only one test, use: End-to-end tests can take a while to run. To run only one test, use:
@ -107,3 +107,7 @@ $ LIVE_RELOAD=0 docker-compose up -d
# Wait 2-3 minutes for the environment to start, then: # Wait 2-3 minutes for the environment to start, then:
$ PROJECT_DIR=$(pwd) docker-compose -f docker-compose.testcafe.yml up $ PROJECT_DIR=$(pwd) docker-compose -f docker-compose.testcafe.yml up
``` ```
### A bad wording or a missing language
If you notice a translation error or missing language you can help us by following the [how to translate](docs/dev/how-to-translate.md) documentation.

View File

@ -2,9 +2,9 @@
## How the translation files work ## How the translation files work
In the translations folder, all json files of the form [namespace].[language code].json are interpreted to create languages by the language code in the file name. In the `front/translations` folder, all json files of the form `[namespace].[language code].json` are interpreted to create languages by the language code in the file name.
The only mandatory file (the entry point) is the `index.[language code].json` which must contain the properties language, country and default so that the language can be taken into account. The only mandatory file (the entry point) is the `index.[language code].json` which must contain the properties `language`, `country` and `default` so that the language can be taken into account.
Example: Example:
```json ```json
@ -32,6 +32,8 @@ Example:
- main-menu.fr-FR.json - main-menu.fr-FR.json
- chat.fr-FR.json - chat.fr-FR.json
If a key isn't found then it will be searched in the fallback language and if it isn't found then the key will be returned. By default the fallback language is `en-US` but you can set another one with the `FALLBACK_LANGUAGE` environment variable.
## Add a new language ## Add a new language
It is very easy to add a new language! It is very easy to add a new language!