iphone doesn't refresh the localized icon after you change language setting ! - iphone

I manage to localized app icon and app name for different languages.I found the icon changes depending on the language setting on the iphone only when the first time when you install the app from xcode.
after that, if i change the language setting, the app icon stay the same but only the app name changes to the localized one.
Anyone has an idea is there is way of solving the problem? it seems iphone doens't refresh the icon after you change the language setting.
Tony

I am going through the same problem right now and my conclusion is you are right. There seems to be no way as of now to change the icon on the fly with the language settings.

Have you tried cleaning (Build > Clean or Cmd+Shift+K) before changing the language setting and rebuilding your entire project? I find doing that fixes my app icons all the time. Also, be sure you're changing your iPhone Simulator language settings and not your Mac OS X language settings.

Related

Change Keyboard in XCUITest/Simulator

I want to change the keyboard language programatically for my XCUITests to try various different keyboards. I've tried:
XCUIApplication().launchArguments += ["-AppleLanguages", "(fr)"]
XCUIApplication().launchArguments += ["-AppleLocale", "fr_FR"]
But this only changes language and locale, but it still keeps simulator default keyboard. I know I could probably do it by going to the settings app (inside of the UITest) and just change keyboard, but I'd like to do it as an input argument or similar.
I also don't want to have all keyboard languages installed on the simulator at the same time, only the one language I choose.
How can I accomplish this?
Since you do it in Simulator, you can access the entire macOS disk space, including Simulator support files.
Each simulator has its own setting located in
$HOME/Developer/CoreSimulator/Devices/SIMULATOR_ID/data/Library/Preferences/.GlobalPreferences.plist
In this file, you can change AppleKeyboards programmatically.
New path for .plist file to change properties of keyboard from Roman Zakharov's answer:
/Users/YOUR_USER/Library/Developer/CoreSimulator/Devices/YOUR_SIMULATOR_ID/data/Library/Preferences/com.apple.keyboard.preferences.plist
Simulator ID can be found from Xcode: Window -> Devices and Simulators -> Simulators. The Identifier value is the UDID.

Xcode Base internationalization doesn't work

I'm trying to localize my app.
I noticed that if I add a language every localized file become doubled.
In this way it's impossible to maintain code or storyboard so I learnt that I need Base internationalization.
The problem is that when I select that checkbox in xcode project setting it shows a window without nothing to select, does anyone know how to fix this?
Here's a screenshot
First, you need to go to your storyboard file, open the bar on the right side, and go to Show the File Inspector, the furthest tab to the left. Then, scroll down and click localize. After this, when you check Use Base Localization, you should see the storyboard appear.
This could happen if Base Internationalization was active before then disabled and files deleted manually.
Create Base.lproj folder in your project folder using the finder.
Move your main story board to it also using the finder.
fix the reference to it from Xcode.
remove app. from device, clean & build your project.
All will be back to normal.

iPhone Settings Icon Graphics (Icon-Small#2x) Not Updating

Has anyone ever had an issue with iPhone settings icons not updating with new graphics? I added a new Icon-Small#2x.png to my project, but when it builds to the device the settings app still uses the old graphic even though it's no longer there and even if I delete the app before installing! Note that in the simulator's setting app everything updates just fine.
What am I missing here? The exact name of the file is Icon-Small#2x.png, which is the exact name recommended by Apple, and I've made sure to add all my icon files to the info.plist.
Try Clean first, and then Build.

Change my Settings language

I'm now translating my app. I've already translated every view and data inside the app but I've also some settings for the app in the Settings menu of the iPad. All of them are in Spanish and I would like to translate them depending of the language set on my app (or set at system settings, never mind). I'm attaching a little screenshot of my settings Screen.
How can I translate it?
Thanks!

iPhone - System strings not localized on device

I build a project using XCode 4 and I was running on the simulator since now. I had noticed that the strings in System type "Edit" and "Save" buttons where in english, but everything in my simulator was set to french. I suspected a bug like the one I had in XCode 3.
But now I'm running on my pure french configured iPhone, and those buttons are still in english, and are not localised as in other apps I can use.
I noticed that in my info.plist, the "Localization native development region" was set to "en" by default. I've changed this to "Fr" or "France" in the drop down menu, but that does not chage anything.
How may I correct this to make those buttons show a localized title ?
I had basically the same question, but Black Frog's answer didn't really help me. I did some research and this is what I found out:
The localization is primarily based on the bundle. With info.plist you can add localizations that aren't in the bundle, but you can't remove localizations that are present in the bundle.
The preferred way to add a French localization in Xcode 4 is to do the following:
Open project in Xcode >= 4.0.2
Click on project file
Select item under Project title on the right
Check Localizations table.
Select the localization you want to duplicate (English)
Click + and select the language you want you're app to use (French)
If you don't wan't to support English there are two additional steps:
Select the localization you want to remove (English)
Click - and delete the files
Special thanks to Nekto who helped me figure this out.
You have to create localized version of your nib files. Or you can set the text of each button/label to a localized string in view load.