Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS : mismatched translation

I'm trying to add a language to my app and it was working until now. After a day to try to understand what's happen, I give up.

This is my problem :

My base language is english (development language) and my other language is french. I have some localizable strings in Main.storyboard and Localizable.strings.

Export is working, no problem with that but when i'm trying to import Xcode i have some warning : "Mismatched translation" and then if i import, nothing change : I have no information about this Mismatched Translation

Somebody have any idea to help me ??

like image 917
Arnaud Verrier Avatar asked Sep 14 '16 16:09

Arnaud Verrier


2 Answers

In my case the "mismatched translation" was caused by a mismatch between the base language (English) string in my code (the value: parameter of the NSLocalizedString call) and the English string in the XLIFF file being imported. That shouldn't normally happen, but in this case the source code had been modified after the XLIFF was exported and before the translated XLIFF was imported. Still, it would be awfully nice if Xcode would pinpoint which one of my 450 translation units had the problem!

like image 93
rene Avatar answered Oct 20 '22 20:10

rene


For anyone faces this issue with latest Xcode version, basically, mismatch means, you changed the source from exported file, you should change(translate) only the target, as changing the source makes mismatch with current source in Xcode, hence no effect as if xcode could not see translation for the source it has of main lang as you changed source by translating it with the target!

Kindly check the attached image, you should only translate Target if it needs translation, the source should not be touched! enter image description here

like image 32
IsPha Avatar answered Oct 20 '22 21:10

IsPha