Skip to content

Commit b74a718

Browse files
committed
GITBOOK-377: change request with no subject merged in GitBook
1 parent 6a2b6c9 commit b74a718

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

‎how-to/extracting-translations.md‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# Extracting translations
22

3-
At some point you will come to the question how to get new translation key/values into your namespace \(translation\) file.
3+
At some point you will come to the question how to get new translation key/values into your namespace (translation) file.
44

5-
## 1\) Adding new strings manually <a id="1-adding-new-strings-manually"></a>
5+
## 1) Adding new strings manually <a href="#id-1-adding-new-strings-manually" id="id-1-adding-new-strings-manually"></a>
66

77
While for sure this is the least efficient method for adding new translations, we know a lot of projects are doing this. There is actually nothing wrong with it beside being some extra work developers could avoid.
88

9-
## 2\) Using an extraction tool <a id="2-using-an-extraction-tool"></a>
9+
## 2) Using an extraction tool <a href="#id-2-using-an-extraction-tool" id="id-2-using-an-extraction-tool"></a>
1010

11-
Static extraction tools can read through your code files to automatically find and export translation keys. [i18next-scanner](http://i18next.github.io/i18next-scanner), [i18next-parser](https://github.com/i18next/i18next-parser) and [babel-plugin-i18next-extract](https://github.com/gilbsgilbs/babel-plugin-i18next-extract) are sensible choices to achieve this goal.
11+
Static extraction tools can read through your code files to automatically find and export translation keys.
12+
13+
Use the **official ⭐** [**i18next-cli**](https://github.com/i18next/i18next-cli) - a high-performance, all-in-one command-line tool for i18next. It handles key extraction, code linting, locale syncing, and type generation. It's built with modern technologies for maximum speed and accuracy. This is the recommended tool for all i18next projects.
14+
15+
[i18next-scanner](http://i18next.github.io/i18next-scanner), [i18next-parser](https://github.com/i18next/i18next-parser) and [babel-plugin-i18next-extract](https://github.com/gilbsgilbs/babel-plugin-i18next-extract) are alternative choices to achieve this goal.
1216

1317
_Or try_ [_translation-check_](https://github.com/locize/translation-check)_, it shows an overview of your translations in a nice UI. Check which keys are not yet translated._
1418

1519
For more information about extraction tools, see [plugin and utils](https://www.i18next.com/overview/plugins-and-utils#extraction-tools) documentation page.
1620

17-
## 3\) Runtime extraction <a id="3-runtime-extraction"></a>
21+
## 3) Runtime extraction <a href="#id-3-runtime-extraction" id="id-3-runtime-extraction"></a>
1822

1923
I18next has a setting to send all keys that it was unable to resolve during runtime using the attached backend.
2024

@@ -40,7 +44,7 @@ export default i18n;
4044

4145
Check the [options](https://github.com/i18next/i18next-http-backend#backend-options) for where missing translation gets sent.
4246

43-
Using node.js and express? You can get that endpoint for free: [https://github.com/i18next/i18next-http-middleware\#add-routes](https://github.com/i18next/i18next-http-middleware#add-routes)
47+
Using node.js and express? You can get that endpoint for free: [https://github.com/i18next/i18next-http-middleware#add-routes](https://github.com/i18next/i18next-http-middleware#add-routes)
4448

4549
This is the most convenient way of working with react-i18next: just develop and run your applications without worrying too much about adding translations to your catalog as those get added automatically.
4650

@@ -49,4 +53,3 @@ Wanna have this process on steroids? Just hook up a [locize.com](https://locize.
4953
{% endhint %}
5054

5155
{% embed url="https://youtu.be/osScyaGMVqo" %}
52-

0 commit comments

Comments
 (0)