Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localising nib files

I am writing a app which has about 10 nib files for conveying different UI messages and for taking user input. I want to know how to localize these messages that appear on my custom sheets. Is there any way i can have a single file with generic strings and depending on language it replaces the generic string with string in that particular language. also i want to know how to load dynamic strings into messages in custom sheets like file names or the number of files selected etc.

i have taken a look at ibtool but doesnt it duplicate the nib files by creating .lproj files for different languages? doing this simply makes the size of my app huge.

Thanks

like image 782
King Avatar asked Feb 06 '26 00:02

King


1 Answers

At a Boston cocoa-heads meeting a while ago, we discussed this topic and came to a consensus that where two decent approaches.

1 - The first is it either use IBTool or manually make separate nibs.

2 - Gain programatic access to your labels and change the text programatically. Mipadi mentions Localizable.strings as being useful. To gain programatic access, you can either wire-up each label through IB, or you could do some king of walk-the-nib magic and find all of the labels (exercise left to the reader).

Pick whichever method fits your particular app.

Hope this helps,

JJ

This question might help: IPhone localization: Is it possible to translate nib files...

like image 174
JJ Rohrer Avatar answered Feb 07 '26 23:02

JJ Rohrer