简体   繁体   中英

change application icon and application name through localization in Xcode iPhone programmatically

I am working on Localization of my App to support English and Spanish language.I have created the string files for both english and spanish.All the strings in my app are managed by

`NSLocalizedString(@"key", nil);`

and give the expected result.I have given an option for changing the language inside my app in a tableview.

NSUserDefaults *nsdefault=[NSUserDefaults standardUserDefaults];
nsdefault setObject:[NSArray arrayWithObject:@"en"] forKey:@"AppleLanguages"];
nsdefault synchronize];

1) I need to change the app name and icon depending on the selection of language in tableview.For app name i used "CFBundleDisplayName" = "Librairie"; so that the next time i launch the app the app name and icon should change.

2)for app name

`"CFBundleDisplayName" = "Librairie";`

.It works only if i go to iPhone's setting and change the language manually.Through code it doesn't work.

Please suggest me the approach i can follow so that when i choose spanish language from my tableview the name and icon gets replaced.

can i localize the app icon image also like we do for any image used in UIView ?

Any help would be appreciated

Thanks

You can't change neither the app icon, neither the display name. Both of those are read only once the app is installed, and even if you could, those would create a really bad user experience.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM