Make update-language-files command more useful (#2198)
* [empty commit] pull request for Fix language update script * Avoid mass changes with update-language-files This commit updates the update-language-files script to prevent mass changes as seen on a number of recent PRs where the contributer has ran the script and comitted the results. The script has been updated to now require the --language argument to specify which language file to update. This ensures that only that file is updated instead of all files. If the provided language code does not already exist, a new file with that code is created. This should make it easier to add new languages as you only need to pass the language code to the script. The base lang code is now also passed as an optional argument to negate the need for a seperate script entry in package.json. The script has been restructures into a couple of functions to make it easier to understand. ESlint now only checks the changed file instead of them all in order to improve performance. Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com> * Updated translation docs for new command Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com> * [update-language-files] Add cross-env-shell Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com> Co-authored-by: Louis Lam <louislam@users.noreply.github.com>pull/2202/head
parent
df2f536845
commit
f67d7cdf3f
@ -1,10 +1,13 @@
|
|||||||
# How to translate
|
# How to translate
|
||||||
|
|
||||||
1. Fork this repo.
|
1. Fork this repo.
|
||||||
2. Create a language file (e.g. `zh-TW.js`). The filename must be ISO language code: http://www.lingoes.net/en/translator/langcode.htm
|
2. Run `npm run update-language-files --language=<code>` where `<code>`
|
||||||
3. Run `npm run update-language-files`. You can also use this command to check if there are new strings to translate for your language.
|
is a valid ISO language code:
|
||||||
4. Your language file should be filled in. You can translate now.
|
http://www.lingoes.net/en/translator/langcode.htm. You can also use
|
||||||
5. Add it into `languageList` constant.
|
this command to check if there are new strings to
|
||||||
6. Make a [pull request](https://github.com/louislam/uptime-kuma/pulls) when you have done.
|
translate for your language.
|
||||||
|
3. Your language file should be filled in. You can translate now.
|
||||||
|
4. Add it into `languageList` constant.
|
||||||
|
5. Make a [pull request](https://github.com/louislam/uptime-kuma/pulls) when you have done.
|
||||||
|
|
||||||
If you do not have programming skills, let me know in [the issues section](https://github.com/louislam/uptime-kuma/issues). I will assist you. 😏
|
If you do not have programming skills, let me know in [the issues section](https://github.com/louislam/uptime-kuma/issues). I will assist you. 😏
|
||||||
|
Loading…
Reference in new issue