-
Notifications
You must be signed in to change notification settings - Fork 40
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
Detect changed translations #60
Comments
This seems like a good suggestion. However, currently I don't really have much time for new features, but feel free to take a stab at a pr! |
You can achieve this using npm-watch as follows: package.json {
...
"scripts": {
"manage:translations": "node ./translationRunner.js",
"watch": "npm-watch"
},
"watch": {
"manage:translations": "src/translations/extractedMessages/**/*.json"
}
...
} And then run |
Thanks @mgtitimoli this will help detect changed reservations on the fly. But what we'd really need is that translationRunner.js persists these changes. gettext inserts the keyword Fuzzy in the .po files as a comment. As long as the keyword fuzzy is present the incorrect translation is not being used any longer but the fallback. This workflow is "pro" and we need that here as well. So I suggest the following workflow:
an alternative would be to include comments in the JSON files for the translators and then minify them to get the resulting language JSON files for production. what do you think? |
@googol7 Thx a lot for your input. This is definitely a problem I want to tackle, and your described workflow seems feasible. Since I couldn't come up with an approach myself, I'll give this a try (when I have some spare time) but this might be the first step to a good solution. I would go with a separate fuzzy file, since JSON actually doesn't support comments, and adding support with for example JSON5 will probably be more difficult than adding a fuzzy file. |
@GertjanReynaert Thx for picking up this suggestion. I think it would be good to also have the old and new default message (oldTranslation, newTranslation) so that it’s obvious that a translator made a new translation in the field "newTranslation" when we get back the file fuzzy_de.json from him. Just made a test - I think this could work:
|
Any progress? |
Same on my side, it is quite important to be able to detect updated 'values'. At the moment, the extracted messages in defaultMessage.json file contains the updated value, but the ouput locales files related values are not updated. I would expect that if a value in defaultMessage is updated compared to the default locale, it should invalidate all related values in other locale files. Maybe replace the previous value with EDIT: I am using a 3rd party translation provider, and committing updated locales to github directly has an impact the rest of the workflow. However as the values in the locales are not invalidated (that's why I would suggest to at least have an option to force them to undefined in the output locales), the 3rd party can't mark them as fuzzy to include the new pair as part of the new batch of translations :) EDIT2: Deleting key and adding key is for everybody 90% of translation management, but we often have to update existing copies, which does not change the key itself inside the pair. Keep up the good work ! |
+1 - We're currently running into an issue where we have the translation files that contain a mix of both translated and untranslated strings. If the default message of any untranslated strings are changed, I would expect all the translation files to also update those strings without their respective JSON objects automatically also. My workaround is to delete all the untranslated strings in the translation files and just run the translation script again, but it's a hassle and can be easily forgotten. Would be awesome to have this enhancement implemented! |
At the moment react-intl-translations-manager reports
if there’s a translation for a string but it doesn’t detect if the original string changed.
If the original string changes then the translations of the other languages should be marked as fuzzy so that the translators know that they have to change the translated string to match the new meaning.
E.g. gettext: https://www.gnu.org/software/gettext/manual/html_node/Fuzzy-Entries.html
The text was updated successfully, but these errors were encountered: