README.md in i18n-tasks-0.9.21 vs README.md in i18n-tasks-0.9.22
- old
+ new
@@ -5,11 +5,11 @@
<img width="539" height="331" src="https://i.imgur.com/XZBd8l7.png">
This gem analyses code statically for key usages, such as `I18n.t('some.key')`, in order to:
* Report keys that are missing or unused.
-* Pre-fill missing keys, optionally from Google Translate.
+* Pre-fill missing keys, optionally from Google Translate or DeepL Pro.
* Remove unused keys.
Thus addressing the two main problems of [i18n gem][i18n-gem] design:
* Missing keys only blow up at runtime.
@@ -20,11 +20,11 @@
i18n-tasks can be used with any project using the ruby [i18n gem][i18n-gem] (default in Rails).
Add i18n-tasks to the Gemfile:
```ruby
-gem 'i18n-tasks', '~> 0.9.21'
+gem 'i18n-tasks', '~> 0.9.22'
```
Copy the default [configuration file](#configuration):
```console
@@ -81,18 +81,28 @@
-h, --help Display this help message.
```
### Google Translate missing keys
-Translate missing values with Google Translate ([more below on the API key](#translation-config)).
+Translate missing values with Google Translate ([more below on the API key](#google-translation-config)).
```console
$ i18n-tasks translate-missing
# accepts from and locales options:
$ i18n-tasks translate-missing --from base es fr
```
+### DeepL Pro Translate missing keys
+
+Translate missing values with DeepL Pro Translate ([more below on the API key](#deepl-translation-config)).
+
+```console
+$ i18n-tasks translate-missing
+# accepts from and locales options:
+$ i18n-tasks translate-missing --backend deepl --from en
+```
+
### Find usages
See where the keys are used with `i18n-tasks find`:
```bash
@@ -293,11 +303,11 @@
write:
- ['devise.*', 'config/locales/devise.%{locale}.yml']
- 'config/locales/%{locale}.yml'
```
-If you want to have i18n-tasks reorganize your existing keys using `data.write`, either set the router to
+If you want to have i18n-tasks reorganize your existing keys using `data.write`, either set the router to
`pattern_router` as above, or run `i18n-tasks normalize -p` (forcing the use of the pattern router for that run).
##### Key pattern syntax
A special syntax similar to file glob patterns is used throughout i18n-tasks to match translation keys:
@@ -338,11 +348,11 @@
For more complex cases, you can implement a [custom scanner][custom-scanner-docs].
See the [config file][config] to find out more.
-<a name="translation-config"></a>
+<a name="google-translation-config"></a>
### Google Translate
`i18n-tasks translate-missing` requires a Google Translate API key, get it at [Google API Console](https://code.google.com/apis/console).
Where this key is depends on your Google API console:
@@ -355,10 +365,21 @@
Put the key in `GOOGLE_TRANSLATE_API_KEY` environment variable or in the config file.
```yaml
# config/i18n-tasks.yml
translation:
- api_key: <Google Translate API key>
+ google_translate_api_key: <Google Translate API key>
+```
+
+<a name="deepl-translation-config"></a>
+### DeepL Pro Translate
+
+`i18n-tasks translate-missing` requires a DeepL Pro API key, get it at [DeepL](https://www.deepl.com/pro).
+
+```yaml
+# config/i18n-tasks.yml
+translation:
+ deepl_api_key: <Deep Pro API key>
```
## Interactive console
`i18n-tasks irb` starts an IRB session in i18n-tasks context. Type `guide` for more information.