So far, I used to manually create a localization file for storyboards
texts, writing a line like this one for each UILabel
/ UIButton
.-
"ACCESS" = "ACCESS";
and translated them with a similar function such as the proposed here.-
Storyboard/XIB and localization best practice
I've just found a nice tutorial to automate xibs
and storyboards
localization.-
http://kb.applingua.com/2011/10/extracting-and-localizing-xibs-ibtool/
which uses ibtool
to automate the localization files creation (a huge step indeed), BUT needs to duplicate storyboard
files to 'import' the new localized labels. I don't want to duplicate my storyboards and do any change twice from now on, but function on the first thread won't work with the automatically generated files, since the generated texts are like this.-
"Qa1-zu-aC4.normalTitle" = "ACCESS";
The first approach I can think of is manually updating the generated files (still, I'd save some time, but it'd be painful as well).
Is there any way to use the automatically generated files to translate the application on runtime without duplicating storyboards?
EDIT
Just found a workaround using regex to transform
"Qa1-zu-aC4.normalTitle" = "ACCESS";
into
"ACCESS" = "ACCESS";
The regex looks like this.-
Find "([^"]*)" = "([^"]*)";
Replace "\2" = "\2";