-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrape all missing keys and send them to Locize backend #315
Comments
Any plans to make this a feature of Locize sometime in the future? Would want to run my own extraction script on the side. |
May I ask how you imagine this to be a feature of locize? What do you expect to be different to i18next-parser oder i18next-scanner? |
Maybe just another npm script / i18n plugin which uses |
Will discuss this topic in the next weeks... |
Seems you can just create an npm script which will do something like this: i.e. having an module.exports = {
defaultNamespace: 'translation',
// Default namespace used in your i18next config
defaultValue: 'missing value',
// Default value to give to empty keys
locales: ['en', 'de'],
// An array of the locales in your applications
namespaceSeparator: ':',
// Namespace separator used in your translation keys
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
output: 'locales/$LOCALE/$NAMESPACE.json',
// Supports $LOCALE and $NAMESPACE injection
// Supports JSON (.json) and YAML (.yml) file formats
// Where to write the locale files relative to process.cwd()
} i18next '/path/to/file/or/dir' && locize save-missing --format json --path ./locales Is this ok? |
Didn't know about the |
Thanks for this project!
As far as I understand, if I am using the following config for my
i18next
, I get all the missing keys send to the Locize backend once they are rendered (in React).It's easy to not spot a missing key this way, because it may be hidden in some closed Dialog component. Is there a way to scrape all the missing keys for the entire application across all languages and namespaces and send them to the Locize backend?
Or is this something Locize CLI is doing? I couldn't find anything about it.
The text was updated successfully, but these errors were encountered: