You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: how-to/extracting-translations.md
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,24 @@
1
1
# Extracting translations
2
2
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.
4
4
5
-
## 1\) Adding new strings manually <aid="1-adding-new-strings-manually"></a>
5
+
## 1) Adding new strings manually <ahref="#id-1-adding-new-strings-manually"id="id-1-adding-new-strings-manually"></a>
6
6
7
7
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.
8
8
9
-
## 2\) Using an extraction tool <aid="2-using-an-extraction-tool"></a>
9
+
## 2) Using an extraction tool <ahref="#id-2-using-an-extraction-tool"id="id-2-using-an-extraction-tool"></a>
10
10
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.
12
16
13
17
_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._
14
18
15
19
For more information about extraction tools, see [plugin and utils](https://www.i18next.com/overview/plugins-and-utils#extraction-tools) documentation page.
I18next has a setting to send all keys that it was unable to resolve during runtime using the attached backend.
20
24
@@ -40,7 +44,7 @@ export default i18n;
40
44
41
45
Check the [options](https://github.com/i18next/i18next-http-backend#backend-options) for where missing translation gets sent.
42
46
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)
44
48
45
49
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.
46
50
@@ -49,4 +53,3 @@ Wanna have this process on steroids? Just hook up a [locize.com](https://locize.
0 commit comments