简体   繁体   中英

German localized string appears in English

My problem is very odd. I am developing an app in 6 different languages (including English and German) and I have localized every single string within the project. Therefore, some texts in the app display in English instead of German.

This happens only for German and always for the same texts. I have run a search of the English strings that shouldn't appear and it is only in English localization files (base files). I clean the project, checked the IDs of the Labels, and anything else. Nothing worked...

Did someone went into a similar issue ?

EDIT: If I try playing with ordering my strings in the German strings file, then I can get the right translations ! But some others won't work anymore.... It looks like a big bug from xCode but it's totally messing up all the project !

Please check you file with your localised strings in German and check that keys are the same you asked in LocalizedString() for that labels.

It happens when LocalazedString doesn't find string for German locale and return it for default locale (English).

Finally found it. It appears that a character has been somehow inserted in the end of a commented line. This character then appears as a comment in xCode, but it is not. Finally, at runtime all translations in lines after this unwanted token will be ignored.

xCode will not help you nor give any warning about it....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM