-
Notifications
You must be signed in to change notification settings - Fork 18
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
Extraction Tool #3
Comments
Hi @beeing, I don't get if you're talking about extracting text from your HTML to a JSON file, or about feeding frenchkiss.js with an imported JSON file. |
Hi, I'm currently using ngx-translate which is similar but for angular. Based on your example, we need to set the language first with string template. set('en', {
hello: 'Hello {name} !',
}); Then use the template by calling: t('hello', { name: 'John' }); // => 'Hello John !' However, a natural workflow is to do the following: t('Hello {name}', { name: 'John' }) Then we will need a CLI (command line utility) to extract all the texts from t(). {
"Hello {name}": ""
} We can then duplicate this JSON as en.json or any {locale}.json with different key values. I hope you get the idea. |
Just to add in, when the JSON is completed, we can use: set(locale, loadFromJsonFile) so that |
I think you should take a look at i18next-scanner (or another tool). |
You can try https://github.com/lukasgeiter/gettext-extractor. po2json or https://github.com/perch-foundation/po-loader can be used to convert the PO data. |
Ok, looks like this is quite the same. Perhaps can add this into README for a complete picture. |
Nice library! Just wondering whether there's a way to extract the texts to external file such as JSON for further translation?
The text was updated successfully, but these errors were encountered: