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: content/blog/i18n-check-end-to-end-testing-i18n.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ summary = "i18n-check can be used to test your React internalization end to end
8
8
9
9
## Introduction
10
10
11
-
[i18n-check](https://github.com/lingualdev/i18n-check) was created to help with general internationalization efforts and originally focused on finding **untranslated** or **invalid** translation messages. While finding differences between locale files is useful, there is another important aspect that an end to end testing tool needs cover: the actual codebase.
11
+
[i18n-check](https://github.com/lingualdev/i18n-check) was created to help with general internationalization efforts and originally focused on finding **untranslated** or **invalid** translation messages. While finding differences between locale files is useful, there is another important aspect that an end to end testing tool needs to cover: the actual codebase.
12
12
13
-
While the locale files can be based on a specific format, i.e. `ICU` messages, the codebase is coupled to a specific programming language and/or framework. So the **general locale file checks can be applied to a broader range of languages and frameworks** (as long as they generate a valid file), but this approach doesn't work for when needing to parse and understand the codebase.
13
+
While the locale files can be based on a specific format, i.e. `ICU` messages, the codebase is coupled to a specific programming language and/or framework. So the **general locale file checks can be applied to a broader range of languages and frameworks** (as long as they generate a valid file), but this approach doesn't work when needing to parse and understand the codebase.
14
14
15
15
To summarize the above situation: `i18n-check` can be used to validate any locale files based on the `ICU` or `i18next` format, but also enables to **test your React application end to end**, as it supports code analysis of `react-intl` and `react-i18next` codebases.
16
16
@@ -38,7 +38,9 @@ Just by looking at the above questions, it's clear that keeping your i18n effort
38
38
39
39
As developers we are dealing with the actual codebase, source and target language locale files and maybe even with external translation management systems that also update locale files at some point in time.
40
40
41
-
**From a developer perspective we want tooling that we can run at a given moment in time and get a quick understanding where we might have to apply changes before running into i18n related runtime errors.**
41
+
{{< tip >}}
42
+
From a developer perspective we want tooling that we can run at any given moment in time and get a quick understanding where we might have to apply changes before running into i18n related runtime errors.
43
+
{{< /tip >}}
42
44
43
45
### Using checks for end to end testing translations
44
46
@@ -179,6 +181,8 @@ Next, we can extend the above command to also run against the source files and c
The above command would yield the following result:
185
+
182
186
```bash
183
187
i18n translations checker
184
188
Source: en-en
@@ -255,11 +259,11 @@ jobs:
255
259
256
260
### What's planned next
257
261
258
-
We have a couple more features planned, that we want add to `i18n-check` in upcoming versions. The most interesting ones include showing error messages, to help with fixing invalid or broken messages and showing translations that exist in target languages, but are non existent in the source locale.
262
+
We have a couple more features planned, that we want add to `i18n-check` in upcoming versions. The most interesting ones include **showing error messages**, to help with fixing invalid or broken messages and showing translations that exist in target languages, but are non existent in the source locale.
259
263
260
-
Other plans include extending the unused keys/undefined keys check to other frameworks aside React, mainly focusing on the JavaScript eco-system as a first step.
264
+
Other plans include extending the unused keys/undefined keys check to other frameworks beyond React, mainly focusing on the JavaScript eco-system as a first step.
261
265
262
-
Finally we might try to add VS Code plugin, to enable run the checks directly inside your IDE and getting some visual feedback on the state of your translations.
266
+
Finally we might try to add a VS Code plugin, to enable running the checks directly inside your IDE and getting some visual feedback on the state of your translations.
263
267
264
268
You can give i18n-check a try today and see if the checks can help improve your localization efforts, especially if you are not using a third party SaaS solution for the translation part (as these often come with helpful information in regards to the state of your localization efforts).
0 commit comments