Xcode Base internationalization doesn't work - iphone

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.

Related

My recent changes in NIB file is not displayed in ios simulator-closed

I've applied changes in interface builder for my app which has labels in it. I just changed the name and position of a label and in addition to that I changed the font of a text view in my app. When I started to run my app, the font remains the same as previous one and none of the labels are displayed in it.
Can anyone help it pls?
in Xcode try this: main menu:product:Clean
if not enough: main menu:Xcode:preferences: -> click over locations icon:
click over the little gray right arrow for derived data:
that will show you the finder folder "DerivedData": delete it.
one other thing to try: in simulator, delete your app.
quite your xcode and then again open your project . Clear your build then run your code.
You should also make sure, that the interfacebuilder file is linked to the target you are starting in simulator.
To do this, select your xib and open the File inspector. There you should see a dropdown named "Target Membership" where you can link the xib to the targets you want.
Also be sure to have the labels defined as IBOutlets in your header file and link them correctly in your xib. Easiest way to do this is using the Assistant Editor and drag the outlet to the header file.
I had the same problem - but only on the iPhone non-retina in the simulator. Cleaning the code did not help. Restarting and rebooting did not help. But removing the app from the simulator worked. Now changes to my UI show up next time I run.
To remove the app from the simulator I did it just like on a real phone. I select the app icon with the mouse and hold it down the mouse button for a few seconds. Then the icon displays a small delete icon that you can select (the app icons shakes too).

Delete by mistake the storyboard

I delete the storyboard by mistake from my app.
Where I can find it and restore it,
or I lost it?
The default storyboard filename is Main.storyboard, so that's what you should look for unless you gave it a different name. (Older versions named it MainStoryboard.storyboard, so if you are working on an older project, you might need to look for that instead.)
First, check your project folder (using the Finder). If it's there, you can drag it back into your project in Xcode, or you can use the “Add Files to …” menu option.
If it's not there, check the trash can. If it's there, you can right-click it and choose “Put Back”, then follow the steps in the previous paragraph.
Try running again your app and Xcode will create the file automatically, this worked for me.

Why can't I add a child pane plist file into my project's Settings.bundle?

I'm running Xcode 4.1 and I've been following a tutorial about app settings. Everything has been going great up until I get ready to add a plist for a child pane that I want to add.
The video tutorial I'm watching (also using Xcode 4.1) shows the guy right-clicking the settings.bundle and choosing Add File... and then saving a file named More. In the video tutorial, he ends up with a More.plist showing up in the project and also in the settings.bundle right in the same level with the Root.plist. I just get it in the project. Nothing in the settings.bundle, and I can't figure out how to copy it there.
I've also noticed that in the tutorial, in the Project Navigator, the settings.bundle has an icon that looks kind of like an outline of a shield. In my Project Navigator, the settings.bundle looks like a white sheet of paper with a corner folded down.
Anyone know what the heck is going on?
FWIW, the root app settings works fine in the simulator. I can see the stuff I set up just fine. I can click on the link to my child pane and it switches to it, but nothing that I added in the more.plist shows up there.
Any help GREATLY appreciated!!
Argh, Apple tends to change things without letting anyone know. The whole settings bundle thing is just not well integrated into XCode if you ask me.
If you ever try to localize your application, you will find that you have to manually add the localization folders to the settings.bundle.
Looks like we have to do the same thing to add child menus now, as just adding the plist file does not put it into the settings.bundle.
Here is the set of steps I just tried that worked.
Open up finder, you can right click or two finger click Settings.bundle and choose "Show in Finder".
Right click Settings.bundle in the finder window, choose show package contents.
Copy the new plist file into this the settings.bundle next to the Root.plist
Delete the new plist from the main project.
I was not able to get the text field to show up under additional .plist page.
My Fix:
Leave only 1 Child.plist file outside Settings.bundle
Navigate to Root.plist
Right click and select 'Show Ray Keys/Values'
Right click and select 'Add Row'. Add:
Key: File
Type: String
Value: Root
In Xcode 4.3.2,
Right click the Project Name in the Project Navigator, and choose Show in Finder.
In Finder, right click the setting.bundle and choose Show Package Contents.
Copy the new .plist to setting.bundle.
Back to XCode, open the setting.bundle, wilfully add one item under the Preference Items, then expand it and modify the value of Type to Child Pane.I can't upload the image, so give the link of the blog.
This problem still exists in Xcode 4.2. Creating and moving [child].plist in Finder does help thanks to John S up there.
Some additional tips.
Make sure to turn on "Show Raw Keys/Values" by right clicking inside the opened root.plist file for the "ChildPane Type" to appear. Also make sure to select "Property List Type" as "iPhone Settings plist". If you're having trouble with ordering items, just open the plist file in a text editor and move the xml elements around accordingly.
Additional additional tip: in Xcode 4.2 to explore/expand the contents of the bundle make sure to set its type to Application Bundle (via File Inspector Menu).
Same issue, waste my almost 1 hour.
1st make sure your plist format is correct.
My solution:
Delete you bundle, and re-build & run.
Now everything is fine...

Correct way to remove ONE localization

Seeing as the sv_SE localization doesn't take effect on the iPhone Simulator, but sv does (with the same language settings set to Swedish (language AND region), I would now like to remove the sv_SE localization to keep things proper.
What's the correct way to do this?
Do I really have to Remove All Localizations and re-do the translation work for the XIBs, as there seems no other way to do it in the Info window?
Mark localization in resources and delete? Delete folder/.lproj? Which is correct?
Xcode 3.2: expand localizable file subtree in left pane (files & groups). Then delete the unwanted localization. You probably want to click "Also move to trash" button.
Xcode 4: select the file, show utilities sidebar (the right one), pick the "show file inspector" button. There is a section with localizations. Select the unwanted one, click minus (-) button. Confirm. Or do it like in Xcode 3.2 deleting the localization from the project navigator. , it's up to you.
Xcode 5: works like Xcode 4.
If you remove all localizations (by mistake for instance) you can add the lproj folders to the project. You don't need to make one by one localizable again.
Tip: better you commit your work, experiment, if your changes doesn't work checkout the previous version and try again.

Localization of Default.png is not working

I wonder if anyone has encountered the same problem and how they solve it.
I want to localize Default.png so I do the following steps which from what I understand should be the correct way (please correct me if I'm wrong).
Select Default.png in xcode
Command-I to Get Info
Click on Make File Localizable
Go back to General Tab (why Apple, why?)
Click on Add Localization
Enter es for Spanish according to this:
In finder I replace the Default.png in the es.lproj folder
I have tried in both the simulator and on an iPhone with changing the language between English and Spanish, but I only get the original file. Other localizations like app name and strings works just fine, but not this one...
I'm on xcode 3.2.3
Thanks
I'd thought I'd add the answer for localizing Launch.xib.
Create InfoPlist.strings file. (File,New,Resource,Strings)
Localize it and select your languages
For e.g. the Spanish version, add your launch screen key and name for the Spanish version of your Launch screen
"UILaunchStoryboardName" = "Launch_es";
Copy your existing Launch.xib to Launch_es.xib, and change the text and/or images to the Spanish translations or Spanish-named images.
I got this solution from Developers Forum (credit to Sascha Paulus, thanks Sascha!).
I had a similar problem in another project with localization, but the solution worked for both issues.
Here we go:
Delete App from Simulator (just to be sure)
Delete all versions of the localized Default.png (in XCode & on Disc)
Select Build > Clean All Targets
If not done yet, make the Localizion Directories (e.g. es.lproj, de.lproj)
Copy the localized Default.png in the appropriate Localizion Directory
Go To XCode > Right Mouse Click on Resources > Add > Existing File ...
Select the localized Default.png in the Localizion Directory
Don't forget to mark "Copy items into destination group's folder...." > Add
Repeat it with every localized Default.png
I think the trick is to delete the file you have a problem with, clean all and then add it again. If you don't have any localization there is no need to create a specific folder.
Give it a try, worked for me.
I have had the same problem. I have solved it with this:
In the Simulator, menu "simulator iOs", option "restart content and settings".
In Xcode, menu "Build", option "Clean All Targets"
And when I have selected the button "Build and run" it has worked.
Just to add that on a latest 4.3.3 every attempt to remove and re-add the files, and the clean all, nothing worked, but what solved everything was the remove-app-from-device-and-simulator and reinstall. Now every image and xib are translated correctly.