For MainWindow.xib I have several localized strings files. Now the problem arises over time when I add new content to MainWindow.xi; every time I would have to manually re-generate the base strings file and do a complex process of compare/copy/merge to other localization files. I'd like to know if there are any tools to automate this tedious and error-prone work. Thanks.
Any tools for auto generate and merge strings files?
You aren't using a base localization? The purpose of that is to create the base strings file automatically (and invisibly) so you don't need to edit those strings manually, ever. The only .strings file you need are ones for custom strings you reference in code, not associated with a XIB or storyboard string.
I'm confused. Do you mean when you add new control say TexField as label onto MainWindow, strings files will be automatically updated? But that's not what I experience. My problem is how to get this new label.title be updated in several localization strings files without re-generating them.
Xcode updates the strings files when you import a localization (that you've previously exported). Other than that, Xcode preserves the strings files in their current form. Note that this works because the keys to the localized strings files are persistent generated strings, so editing existing text in your XIB or storyboard file doesn't affect the structure of the localized strings files. (Admittedly, the localized text doesn't change to refelect your edit, but by definition it's in a different language, so an edit isn't relevant.)
If you're using the export/import localization workflow, therefore, you don't need to handle the localized string files at all. Xcode generates xliff files with the correct (current set of) keys and latest text on export, and merges changed text from the xliff files on import. The only part you're expected to handle is the actual translation within the .xliff files.
If you're not using that workflow, you have to do more work:
(under the heading "Updating Storyboard and Xib Strings Files Using ibtool"). In that case, you can use the ibtool to generate new strings files, and use FileMerge or ibtool itself (according to that documentation) to merge the new files with the existing files.
This is basically the workflow you said you wanted to avoid, so I'd suggest you use the export/import workflow, and edit the language-specifc text via a 3rd-party xliff editor, for which there seems to be a number of choices.
Thanks for your detailed reply. I never knew I could do this using a commandline tool like ibtool. I use IDE to regenerate and replace existing strings files (and do revert using svn which is quite complex and tedious).
I am planning to build an app to automate all these tedious work.