-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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
Text missing for empty translation target #15754
Comments
If you specify an empty target... the target message will be empty - I think this is working as expected. However If the message is not part of the translation bundle (your xliff file) then the original message will be used. If this makes sense please close the issue. |
@vicb But then I think the bug is then that the xi18n tool generates the empty tags. The meaning of this is that angular by default translates everything with an empty string. I don't read the XLIFF specification, but according to Wikipedia the If Angular would generate the xlf file without target, you could copy it for each language as suggested in the documentation without problems of missing translations. For this Angular could somehow interpret a missing Drawback would be that users have to know that they must add the target element and also if you edit the file manual the extra typing. If you want to keep the current behavior, it would at least be helpful to write this in the documentation. |
This is not really a bug, but more like a feature request.
I don't think 3/ is the good solution. I'd go with either 1/ or 2/ |
2/ :+1: I still think not translating is better than translating with empty string (what 1/ would do). Just copy source to target would be fine. I tried to get more information how this general is handled. I read through the XLIFF spec, but I don't find more information than the general info that target is optional. Also I searched for other xlf files on github and found projects for all cases 1/ 2/ 3/, so I think there is no general solution. |
Same "bug" for me. I have an application in French, so i18n source is in French. I'm using tools like kendo, with source in english, so I need a messages.fr.xlf file to translate its source in french. I think not translating is better than translating with empty string, but if this is not a feature request, is there any tool to complete all empty target automatically by the source element? Many thanks, |
@martinroob do you think that you can add this to your ngx-i18nsupport tool? |
This is exactly what ngx-i18nsupport does by default. |
Thanks for mentioning @martinroob's tool. Works perfectly for me with this. But I still think the current Angular behaviour is strange. (Perhaps the existance of a support tool is also a big argument for this 😄 ) |
I think I've found an even easier solution, based on the comment from @vicb:
I deleted all the lines from the Seems a bit weird to bother with passing in the i18n arguments at all when building for English, but at least it keeps the build process the same for all languages. |
Hello, faced the same problem. Like @sunild said, removing the source from xlf file solves the problem. However I was wondering if it would be great to set a flag while generating the xlf file? This way we wouldn't need to manually remove the entries. |
Ok, got the problem. |
Thank you for working on this tool but please consider the following: Is there an optional parameter which can be passed to the extraction tool, to still produce the empty A change such as not generating Since I upgraded to the latest version of Angular (4.4), my Locale AOT builds are broken and I figured out that is because now the Angular extraction tool, does not generate the empty tag in the messages.xlf file anymore. I had a custom script to add customized localized strings to the messages.xlf file based on the existence of |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
creating a messages.xlf using Angular CLI:
ng xi18n
As i don't need to translate English to English I use the generated file to build the English version
ng serve --aot --locale en --i18n-file src/messages.xlf
=> All strings are missing
(i think this comes from empty
<target />
in the xfl file)Same for all other languages. Documentation suggests to copy the messages.xlf to /locale/messages.??.xlf. If I now build the localized version with a incomplete translation, all not translated strings are missing.
Expected behavior
I would expect that missing translations show the original string instead of nothing.
Minimal reproduction of the problem with instructions
see Current behavior
What is the motivation / use case for changing the behavior?
Keeping all translation files up to date in time is a complicated workflow and then a not translated string is better than a missing string.
Please tell us about your environment:
Language: N/A
Node (for AoT issues): v6.10.1
The text was updated successfully, but these errors were encountered: