-
Notifications
You must be signed in to change notification settings - Fork 397
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
cli/extract: update source translations #199
Comments
Sounds reasonable. I'm gonna take a look at this issue today. There seems to be many related issues. |
@snegostup I've just created a PR, would you be interested in review? I updated your proposed solution little bit: Instead of translation: config.sourceLocale === locale
? nextCatalog[key].defaults
: prevCatalog[key].translation, there is translation: config.sourceLocale === locale &&
prevCatalog[key].translation === prevCatalog[key].defaults
? nextCatalog[key].defaults
: prevCatalog[key].translation, to avoid loosing custom translations (even in catalog for |
Thanks!
This is really a problem. Like a coder I'm not comfortable having multiple sources of truth (code and catalog) and would gladly have an |
It is indeed suboptimal. What if we add interactive mode to lingui extract? When different
Options would be: |
In simple cases, we could also update message in code automatically. Complex messages like |
Great idea. And I agree that we don't need to update code automatically, just display good message and exit. It reminds me how DBMS would react if you try to create This also reminds me of #200 -- we can also throw similar error message and stop when encountered different messages with same ID within code |
Alright, just to narrow the problem down. This is related only to message catalog for |
👍 |
Fixed and released in v2.2.0. Thanks to all involved! |
This 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 runextract
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:
to
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:
to
What do you think?
The text was updated successfully, but these errors were encountered: