You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
* Install `Homebrew` by `ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
6
6
* Install `Crowdin CLI` by `brew install crowdin` or follow the instructions here: [https://support.crowdin.com/cli-tool/#installation](https://support.crowdin.com/cli-tool/#installation)
7
7
* Get [Crowdin API Key](https://crowdin.com/project/binary-static/settings#api) and add this line to your _.bash_profile_: `export CROWDIN_API_KEY='put API Key here'`<br/>
8
8
**IMPORTANT!** This key gives full access to all your Crowdin project data. Treat this just like a password and never push it to any public repo.
9
9
10
-
#### Update translations
10
+
###To update the translations:
11
11
* Simply run `./scripts/update_translations.sh` in root folder of project to do these tasks:<br/>
12
12
(It is possible to confirm/skip each task by answering y/n to questions, only first one is mandatory):
13
13
* Check out and update the translations branch
@@ -17,7 +17,37 @@
17
17
* Commit changes and push to origin
18
18
* Open github to submit the PR
19
19
20
-
## Update sitemap
20
+
### Extracting texts from js code:
21
+
Texts that are used in js code will automatically be extracted during the translation update process (3rd step above: Updating the source file).
21
22
22
-
* List of paths to include in `sitemap.xml` is here: [sitemap.js](sitemap.js)
23
+
In order to make sure that no strings are missed by the extractor code while pushing to translations, please:
24
+
25
+
1. Refactor the code so that the first argument passed to the `localize()` method is a string literal.
26
+
i.e.
27
+
```js
28
+
consttext=localize(is_started ?'Sell at market':'Sell');
29
+
```
30
+
would change to:
31
+
```js
32
+
const text = is_started ? localize('Sell at market') : localize('Sell');
33
+
```
34
+
2. If there is no way to have the string literal in js code (i.e. API texts which are not translated), add them to `scripts/js_texts/static_strings_app.js`.
35
+
36
+
Note: Regarding API texts, even if the string is translated automatically somewhere else we should still include it here to avoid missing it if that other string gets removed.
37
+
38
+
3. At the end, when you're sure that a string has already been taken care of, just put this comment `/* localize-ignore */` right after the first argument of `localize()` call to ignore it from tests.
39
+
40
+
### `js_texts` folder contents:
41
+
```
42
+
js_texts:
43
+
├── extracted_strings_app.js
44
+
└── static_strings_app.js
45
+
```
46
+
- `extracted_strings_app.js`: Contains extracted strings. It's for debugging purpose only and shouldn't be changed manually.
47
+
- `static_strings_app.js` to handle those strings that don't exist in js code. e.g. API texts that are not localised, etc.
48
+
49
+
During the translation update process, the source file `messages.pot` will be updated with all texts from both the above files.
50
+
51
+
## Updating the Sitemap
52
+
* List of paths to include in`sitemap.xml` is here: [config/sitemap_urls.js](config/sitemap_urls.js)
23
53
* Once the paths are updated in the above file, run `./scripts/sitemap.js` or `grunt shell:sitemap` to generate new`sitemap.xml`
0 commit comments