ios localization issue for library -


i trying develop custom control , plan publish using github drag&drop installation. support localized strings created mycontrol.bundle directory en.lproj , de.lproj folders inside. each folder contains mycontrol.strings language specific content.

in code defined macro this:

#define mylocalizedstring(key) \ nslocalizedstringfromtableinbundle(key, @"mycontrol", [nsbundle bundlewithpath:[[[nsbundle mainbundle] resourcepath] stringbyappendingpathcomponent:@"mycontrol.bundle"]], nil) 

i use

mylocalizedstring(@"whatever_title"); 

in xcode edited schemes "application language" german , "application region" germany. when run in simulator works charm , displays german user interface.

when run on device, set german language , german region, shows me english user interface.

the following code

nsstring *language1 = [[[nsbundle mainbundle] preferredlocalizations] firstobject];     nsstring *language2 = [[[nsbundle mainbundle] preferredlocalizations] lastobject];     nsstring *language3 = [[nslocale preferredlanguages] objectatindex:0];     nslog(@"%@ %@ %@",language1, language2, language3); 

gives me output:

en en de 

what doing wrong?

thanks in advance!

**edit:

the following code

nsstring *language1 = [[[nsbundle mainbundle] localizations] firstobject];     nsstring *language2 = [[[nsbundle mainbundle] localizations] lastobject];     nsstring *language3 = [[nslocale preferredlanguages] objectatindex:0];     nslog(@"%@ %@ %@",language1, language2, language3); 

gives me output:

base en de 


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -