XLIFF makes no sense

I'm really confused by how Xcode handles this now. I've started my app, and made sure anywhere I displayed a string to the end user, I used an NSLocalizedString() macro. I didn't do the silly thing where the key is the english text, as that fails spectacularly pretty quickly. Instead, I did something like this:


NSLocalizedString("LOSER_POINT_MATCH", comment: "The name of final match on the loser's side")


OK, so now I click on my project and do Editor -> Export for localizations, and I get my en.xliff file.


Now I want to make the actual English "translations" for those keys. So I want my Localizable.strings to have a translation of "Loser Point" for the LOSER_POINT_MATCH key.


Anything I'm doing at this point ends up having the Localizable.strings file get corrupted the next time I export/import. Is there a clear blog somewhere that shows how to do this? It's much clearer translating into ANOTHER language, but not so clear how you provide the text for the development language itself.

Are you using an xliff editor or trying to do it with textedit or xcode? You will screw up

that file if you're using anything other than an xliff editor. There are a few free ones

out there and some online versions as well.

I'm doing it by hand. Never found a free one for Mac. All I've done is added the target-language="en" on the file tag, and then the appropriate context in the <target> tag for the translation. When I go in/out/in with that file though, I end up losing all the translations again.

This is an online one but it is free. http: // xliff.brightec.co.uk

The file itself isn't the issue, it's that it's the same language (I think). You can see exactly what I mean by doing this:


  • Put that one and only localization above I showed into a project and do the export.
  • Upload to the site you pointed at and put any translation and save it.
  • Import it back into Xcode and you'll now have a proper looking Localizable.strings file (yay!)
  • Now pretend you've done a bunch more development, so do an Export again. Notice how it's not asking if you want to include existing translations, which I believe is an issue here.
  • Upload the newly exported file to the site again and notice the translation is missing.
  • Look at the xliff file you uploaded and you see it has no <target> element any longer, and the <source> was changed to be the translation.

Which version of xCode are you using? It is supposed to ask if you want to preserve existing translations.

7.2


Did you try what I said? Like I'm saying, I'm pretty sure it's because the development language is the same as what I'm trying to "translate" to, and so it gets confused what is going on.

There are several steps to this process. First and most important, is setting the base development localization.

Then and only then, can you add other localizations. Perhaps this is the issue?

The base development language is already set. Do you mean something else?


Did you try those steps I gave? I think if you do that you'll see exactly what I mean.

I'd really suggest to try a proper editor, vs. by hand, and then see if the issue persists.


Ken

XLIFF makes no sense
 
 
Q