@nkzw/eslint-plugin-fbtee 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,8 +50,8 @@ export default {
50
50
  {
51
51
  "scripts": {
52
52
  "fbtee:manifest": "fbtee manifest --src src",
53
- "fbtee:collect": "fbtee collect --manifest < .src_manifest.json > .source_strings.json",
54
- "fbtee:translate": "fbtee translate --translations translations/*.json --jenkins > src/translations.json"
53
+ "fbtee:collect": "fbtee collect --manifest < .src_manifest.json > source_strings.json",
54
+ "fbtee:translate": "fbtee translate --translations translations/*.json > src/translations.json"
55
55
  }
56
56
  }
57
57
  ```
@@ -59,8 +59,8 @@ export default {
59
59
  Here is what each command does:
60
60
 
61
61
  - `fbtee manifest --src src` searches through files in the `src` directory and generates a manifest file (`.src_manifest.json`) that lists all the files translatable strings marked with `<fbt>`. In addition it creates `.enum_manifest.json` which lists all the files containing `<fbt:enum>` tags. Since these files are auto-generated, we recommend adding them to your `.gitignore`.
62
- - `fbtee collect --manifest < .src_manifest.json > .source_strings.json` reads the manifest file and extracts all the strings marked for translation into a `.source_strings.json` file. This file should be uploaded to your translation provider as the source for your translations.
63
- - `fbtee translate --translations translations/*.json --jenkins > src/translations.json` reads all the translations in the `translations/` directory and compiles them into a single `src/translations.json` file. This file is used by **fbtee** to display translated content in your app. The `--translations` parameter specifies the path to the translation files. The `--jenkins` flag is used to define the utilized [hash function](https://en.wikipedia.org/wiki/Jenkins_hash_function). You can adjust the `--translations` parameter to point to your translation directory. If your translations are within your app directory in a folder called `i18n`, for example, you'd use `--translations app/i18n/*.json`. The output is the translation file used by **fbtee**. This file is going to be referred to in your applications entry point, therefor it needs to be generated as part of the build, but should not be part of version control. This command requires the translations to be present in the `translations/` directory, created based on real translations of what was previously collected using the `collect` command.
62
+ - `fbtee collect --manifest < .src_manifest.json > source_strings.json` reads the manifest file and extracts all the strings marked for translation into a `source_strings.json` file. This file should be uploaded to your translation provider as the source for your translations.
63
+ - `fbtee translate --translations translations/*.json --jenkins > src/translations.json` reads all the translations in the `translations/` directory and compiles them into a single `src/translations.json` file. This file is used by **fbtee** to display translated content in your app. The `--translations` parameter specifies the path to the translation files. The `--jenkins` flag is used to define the utilized [hash function](https://en.wikipedia.org/wiki/Jenkins_hash_function). You can adjust the `--translations` parameter to point to your translation directory. If your translations are within your app directory in a folder called `i18n`, for example, you'd use `--translations app/i18n/*.json`. The output is the translation file used by **fbtee**. This file is going to be referred to in your applications entrypoint, therefore it needs to be generated as part of the build, but should not be part of version control. This command requires the translations to be present in the `translations/` directory, created based on real translations of what was previously collected using the `collect` command. Instead of outputting a single file, you can also specify `--output-dir` instead.
64
64
 
65
65
  Now, the first step is to run these commands to set up the initial strings for translation:
66
66
 
@@ -72,8 +72,8 @@ The files generated by these commands should be added to `.gitignore`:
72
72
 
73
73
  ```
74
74
  .src_manifest.json
75
- .source_strings.json
76
75
  .enum_manifest.json
76
+ source_strings.json
77
77
  src/translations.json
78
78
  ```
79
79
 
@@ -156,11 +156,11 @@ After marking your strings for translation with `<fbt>`, run the following comma
156
156
  npm run fbtee:manifest && npm run fbtee:collect
157
157
  ```
158
158
 
159
- You can now upload the `.source_strings.json` file to your translation provider. One sample for such a translation provider is [Crowdin](https://crowdin.com/).
159
+ You can now upload the `source_strings.json` file to your translation provider. One sample for such a translation provider is [Crowdin](https://crowdin.com/).
160
160
 
161
161
  ### Generated File Structure
162
162
 
163
- Your `.source_strings.json` might look like this:
163
+ Your `source_strings.json` might look like this:
164
164
 
165
165
  ```json
166
166
  {
@@ -255,7 +255,7 @@ Since the `translations.json` is an auto-generated file part of your build proce
255
255
  You can install the optional eslint plugin to catch common mistakes and enforce best practices when using **fbtee**:
256
256
 
257
257
  ```bash
258
- npm install @nkzw/eslint-plugin-fbtee
258
+ npm install -D @nkzw/eslint-plugin-fbtee
259
259
  ```
260
260
 
261
261
  Add the following configuration to your ESLint configuration: