Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift iOS localization - not all strings in main.strings (xcode 6.3)

Tags:

xcode

ios

swift

I try to localize my iOS app. Unfortunately I run into trouble with the localization. My problem is by adding the additional language, not all strings are listed in the main.strings file for the additional language. I have an scroll view and an label in my ViewController. The scroll view itself also has many label. Wenn I go into the main.string file, I miss the separat label as well as the first label in the scroll view. Because the controller is the second view controller working as a description view, I've not added IBOutlets to the label. Just use them as text.

Does anyone know how to add these two label to the main.string file or maybe just give me a hint what I can check to see what's maybe wrong?

Thanks in advance

like image 809
StefanN Avatar asked Feb 25 '15 19:02

StefanN


1 Answers

Ok, after two additional days I've found the reason why it was not working. At all I hope my question was not to silly and all member just thought RTFM.

I've solved my following problems: 1) How can I add additional Label-Text to the Localization file "main.strings" and 2) By adding an Language not all text are entered by Xcode to the main.stings file.

1) In the document block from the identity inspector is a filed called Object ID. This is the Xcode generated reference to the Label (Text). Adding this to the specific language main.strings file with, close the line with an ";" and it works.

2) Well, as far as I could investigate, localization just works with plain text (Attributes Inspector - Block Label). It does not work with attributed text. Maybe I did something wrong, but changing to "Plain" and problem was solved.

Thanks for all who spend some time to read my question.

like image 77
StefanN Avatar answered Sep 22 '22 02:09

StefanN