-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
52 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
# Excluding message catalog build files | ||
# Lingui-generated files in version control | ||
|
||
[`lingui extract`](/docs/ref/cli.md#extract) command creates temporary message catalogs per each source file. Also, [`lingui compile`](/docs/ref/cli.md#compile) command generates compiled message catalogs from source ones. All these files can be safely ignored from VCS and linters. | ||
The [`lingui extract`](/docs/ref/cli.md#extract) command extracts a message catalog (usually a po file) for each locale. Also, [`lingui compile`](/docs/ref/cli.md#compile) command generates minified JavaScript files from the po files. All these files can be ignored from your version control system (VCS). | ||
|
||
Can be safely ignored because these files must be created every time you deploy to production, so we encourage to use CI methods to automatize this process. If you commit it you will produce conflicts, which somebody will need to solve, in this minimized and transpired (basically unreadable to human) file. In summary, please, **always compile your catalogs**. | ||
Every time you deploy to production, the JavaScript files need to be available and up-to-date: your app will get the translated strings from there. It follows that the files produced by `lingui extract` need to be up-to-date as well, otherwise some strings might be missing. | ||
|
||
Replace `locales` in paths below with your custom `localeDir` from configuration. | ||
We encourage you to use CI to extract and compile the catalogs. | ||
|
||
- `locales/_build/` | ||
- `locales/**/*.js` | ||
It's also possible to keep the po files checked in your vcs, but you'll have to deal with potential merge conflicts. | ||
|
||
## Git | ||
|
||
Add following lines to your `.gitignore`: | ||
To ignore the message catalogs, as well as compiled JavaScript files (as discusses above), add following lines to your `.gitignore`: | ||
|
||
```ignore title=".gitignore" | ||
locales/_build/ | ||
locales/**/*.po | ||
locales/**/*.js | ||
``` | ||
|
||
## ESLint | ||
|
||
Specify which directories to lint explicitly or add following lines to your [.eslintignore](https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories): | ||
You should not need to configure anything, because a compiled message catalog has an `/*eslint-disable*/` comment embedded in itself and ESLint will therefore ignore it. | ||
|
||
```ignore title=".eslintignore" | ||
locales/_build/ | ||
locales/**/*.js | ||
``` | ||
If you need to customize what files are ignored by ESLint, read [.eslintignore docs](https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.