Combine stringsdict & Localizable.strings file - ios

Earlier iOS supported Localizable.strings. In iOS10, for handling pluralisation etc iOS introduced new format "stringsdict". Can we just have stringsdict file for all localisation or do we have to maintain multiple files.

Related

iOS Localized in the single project through the Xcode

when I use the NSLocalizedString to localize the app, I create a new strings named Localizable. It worked firstly through the localize and adding the languages.
However, when I delete the Localizable.strings and recreate the strings, there is a problem that can not localize, system can not find the strings and can add language such as zh_hans, english and so on.
See below image for more detail.

Xcode adding localisation strings file for unsupported languages(like indian language sindhi)?

I had given support for multiple languages inside my iOS project using string localization. I had added supported language Localizable.strings files from project setting. But how to do same thing for language which is not available in Xcode list(like indian language sindhi).Please suggest for same.

Can't re-export strings to XLIFF from Xcode 6

I started localizing my iPhone app from English to Portuguese, I added all necessary macros and changed the storyboards following the steps described on the official docs. When I finished I exported it to a Xliff xml file, as expected all english sentences were present on the resulting xml file. I continued the process by translating all sentences to portuguese and imported the xliff file into Xcode. I can now run the app and see all sentences in english or portuguese depending on my simulator configuration and everything works as expected.
Once I imported the XLIFF file there were several files created one of them being the Localizable.strings file which has the mapping between english and portuguese. I have continue developing my application and I'm now in the phase where I want to translate the new english strings I added to the project to portuguese. I tried the same process:
Export XLIFF with the current translations
Modify the XLIFF
Import it again back into Xcode
But for some reason that I'm not aware of I get a "Duplicate localized resource Localizable.strings found ".
Question being: How can I export a XLIFF file with the current translations in a way that I can modify it and import it to xcode again ?
Thanks in advance
Ze

Xcode 6 localization of plurals & genders with XLIFF

In Xcode 6 the XLIFF file format is now used for localization of strings. However, I need localise plurals and genders. How can I do this in Xcode 6?
As far as I understand, the XLIFF file now replaces the Localizable.strings file. In iOS 7/ OS X 10.9 we could localise plurals & genders by adding Localizable.stringsdict but this requires a Localizable.strings to exist. But since now there is no Localisable.strings file, how can I get the Localizable.stringsdict file to work?
As of Xcode 6, Apple uses XLIFF as the file format for exporting your project for localization. However, nothing has changed inside the project itself. You should continue using Localisable.strings and Localizable.stringsdict files to handle plurals per Apple's documentation on Handling Noun Plurals and Units of Measurement.
You can refer to this Objective-C project or this Swift project as examples of using strings dictionary files for plurals with Xcode 6.
A little more background on XLIFF and Xcode 6:
XLIFF (XML Localisation Interchange File Format) is an XML-based format created to standardize the way localizable data are passed between tools during a localization process. XLIFF was standardized by OASIS in 2002.
When you click on Editor -> Export for Localization in Xcode, it packages up all of your localizable assets into an XLIFF file that can be handled off to translators for localizing your application's strings. Since XLIFF is a standardized file format, this means translators and translation tools do not need to understand Apple's internal strings format.
Here's an example of the resulting XLIFF document produced by exporting the above referenced Swift project for localization. Now translators can use a translation platform or tool to translate your application's content and return to you a localized XLIFF file. You, as a developer, can then use Xcode's "Import Localizations" feature to import the translated XLIFF file into your project. This will cause Xcode to generate the necessary locale specific strings files from the imported XLIFF.
In short, nothing has changed in how you develop your project. What's been added in Xcode 6 is a new feature to simplify the localization process.
There's one caveat that I should mention though about plurals and exporting for localization. As of Xcode 6.1, Apple's export for localization feature still lacks a way to properly export plurals. This is most likely due to the current XLIFF spec having no standardized way of managing plural representations of a string. There's an open bug with Apple to address this issue.
XLIFF export has full support for plurals starting from Xcode 9
Xcode 9.0 Release Notes:
Added support to XLIFF for exporting and importing stringsdict files, including support for using the correct per-language plural variants. (16785521)

Is it possible to add localization to pre-compiled framework?

I'm using a binary framework in my iOS project. This project is only available in english, but I would like to localize it. Assuming the original author used NSLocalizedString everywhere, is it possible to localize this framework "from the outside"?
It should be possible putting the translations in the Localizable.strings file. It should be easy to try...
If it does not work, sometimes libraries include a localizable strings file in a bundle. Then you should put your translations there.

Resources