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
I recently had a bug where I thought that my translations were not being generated correctly.
Turns out that I had mismatching keys between translation files.
I.e.
It took me a while to figure that out (especially with large translation files).
Would there be an option to have a validation check that is run before the translations are generated?
We could turn it on in the pubspec.yaml configuration.
All that the check would do is the following:
Take the keys from the main translation file (the main_locale option)
For each other translation file, verify that it has exactly the same set of keys
If one or more files do not match the main translation file, exit with an error and perhaps show which files have conflicts and where
This would make it easier to spot the following errors:
missing keys in any translation file (works both ways I think)
the same amount of keys but different names (the issue I had earlier)
The errors could look like:
// missing translation in child translation file
File 'intl_fr.arb' does not have a translation for 'foo'. Either the key does not exist, or its name does not exactly match the one in main translation file 'intl_en.arb'
// translation in child translation file that does not yet exist in the main translation file
File 'intl_fr.arb' has a translation named 'bar' that does not yet exist in the main translation file 'intl_en.arb'
The text was updated successfully, but these errors were encountered:
I have a question about the usage of
intl_utils
.I recently had a bug where I thought that my translations were not being generated correctly.
Turns out that I had mismatching keys between translation files.
I.e.
It took me a while to figure that out (especially with large translation files).
Would there be an option to have a validation check that is run before the translations are generated?
We could turn it on in the pubspec.yaml configuration.
All that the check would do is the following:
main_locale
option)This would make it easier to spot the following errors:
The errors could look like:
The text was updated successfully, but these errors were encountered: