Quote:
Originally Posted by manicaesar
Thanks, it is good to know, but I was wondering if you could attach some code - I'm especially interested in method invoked, when the button is pressed - how to make the language change - how to make used Localizable.strings "swap"? What should I do?
Thanks for your reply!
|
Here is some testing I have done now. I can programatically force to load the view while ignoring the phone's setting
Here is some my sample Code
I use English and chinese as my application language
When loading English nib
Code:
NSBundle *myLocalizedBundle=[NSBundle bundleWithPath:[NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle]bundlePath],"@English.lproj"]];
SomeViewController *viewController=[[SomeViewController alloc] initWithNibName:@"NibName" bundle:myLocalizedBundle];
When loading Chinese nib
Code:
NSBundle *myLocalizedBundle=[NSBundle bundleWithPath:[NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle]bundlePath],"@zh.lproj"]];
SomeViewController *viewController=[[SomeViewController alloc] initWithNibName:@"NibName" bundle:myLocalizedBundle];
Here is my finding, it works for me now.
Let's discuss if there is any new findings