I have two .html files that use the same translation i18n="@@MY_TRANSLATION". Is it okay to use the same i18n in two different files, or even the text is the same I do need to use different key? For instance, i18n="@@MY_TRANSLATION_2", but in this case the same translation appears in .xlf file twice.
Same translations in different files
230 views Asked by user10608855 At
1
If you want to translate exactly the same text in both files, but it should appear only once in the translation file, then you can give both texts the same ID. This is totally fine. If the content is different it will display a warning, when exporting the translation file.
If you use two separate IDs, like in your example, this will result in two separate translations in the XLIFF. If you have different content that needs to be translated you need to use different IDs, this is also stated in the documentation.
See also the Manage marked text with custom IDs in the Angular documentation. This page probably clarifies most questions.