L
L
lubimow2013-09-28 22:13:01
iOS
lubimow, 2013-09-28 22:13:01

Localization in xcode?

I use xcode 5.
As I understand it, localization is a little different.
I added languages, I created files:
Main.strings(Russian)
Main.strings(Italian)
and
apps-info.plist (Russian)
apps-info.plist (Italian)
and
InfoPlist.strings(Russian)
InfoPlist.strings(Italian )
In some manuals for xcode 4 and later, it is written that you need to create a localizable.strings file and localize it.
Question: Should it be done?
As I understood from the literature, in the InfoPlist.strings files I write: "Back" = "Back"; (in different languages)
Then you need to write something like this - NSLocalizedString (@ "Back", nil);
Question: Where to register it, and what does @"Back" mean? Is @"Back" a title?

The main task of localization is to translate buttons.
In the Main.strings(English) file, the following code
* Class = "IBUIBarButtonItem"; title = "Back"; ObjectID="fqu-r0-dDY"; */
"fqu-r0-dDY.title" = "Back";
/* Class = "IBUIViewController"; title = "AW13/14"; ObjectID = "fts-kV-qn9"; */
"fts-kV-qn9.title" = "AW13/14";

Further in NSLocalizedString(@"Back",nil); we add, for example, "AW13/14" (and, accordingly, the translation in the InfoPlist.strings file) - did I understand correctly?
What happens if I just in the file (for each language) - Main.strings (Russian) - translate the buttons manually - will this be correct?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
gleb_kudr, 2013-09-29
@gleb_kudr

Then you think about porting your application to another platform and regret that you contacted platform-specific solutions.
I did it like this - a localization dictionary (based on SQLite) + my own class, dragging values ​​from there at runtime. Easier nowhere. And there is room for resolving difficult situations, for example, if your inscription in one of the languages ​​\u200b\u200bdoes not fit where it should fit. Or the language has a different direction of writing.

A
Andrey Bistriy, 2013-12-01
@Bistriy

I recommend Lin . It is better not to climb into InfoPlist.strings with your hands.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question