cli/extract: update source translations
See original GitHub issueThis is obviously only relevant when using messages with custom IDs.
Right now if we extract
messages and then decide to update them (in source code) and run extract
again - it won’t update the messages in catalog. It will leave initial strings and there’d be no way to update them other than manually edit the catalog.
I think it shouldn’t be like that and we should update source catalog with updated messages in this case.
We can change this string:
translation: prevCatalog[key].translation,
to
translation: config.sourceLocale === locale ? nextCatalog[key].defaults : prevCatalog[key].translation,
And this leads to another issue 😃 (I wrote about it here) - when using minimal
format with custom IDs, it extracts as 'message.id': 'message.id'
instead of 'message.id': 'default message'
This can be fixed here, changing:
translation: config.sourceLocale === locale ? key : "",
to
translation: config.sourceLocale === locale ? message.defaults : "",
What do you think?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
API Reference - CLI (@lingui/cli) — LinguiJS documentation
@lingui/cli manages locales, extracts messages from source files into message catalogs and compiles ... Update translations for sourceLocale from source.
Read more >Work with translation files - Angular
Complete the following steps to create and update translation files for your project. Extract the source language file. Optionally, change the location, ...
Read more >POEdit: Can't update translations from Source Code
I am using POEdit for translations in a web application. However, when I start POEdit I can't find any sources when I run...
Read more >Files Management | Crowdin Documentation
To download translations for the chosen file, select the required languages, and click Build & Download. Updating Source Files. In case you have...
Read more >Download languages to use offline - Google Translate Help
Update or remove languages · Connect to Wi-Fi. · On your Android phone or tablet, open the Translate app Translate app . ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed and released in v2.2.0. Thanks to all involved!
Alright, just to narrow the problem down. This is related only to message catalog for
sourceLocale
inminimal
format. I think--overwrite
makes more sense than--update-defaults
.