I have a launch image Default-568h#2x.png which I've localized for English (it sits in my en.lproj folder). Now I'd like to produce one other version of that image for every other language (I've removed the english text from it). How would I go about setting this up? I've tried putting an image with the same name in the top directory but that doesn't work. Do I need to rename to something?
Basically, when you localize to any language (eg: Spanish), you will see another folder such as "es.lproj", the Localizable.strings and other localized files will be there.
You may check http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014
for the step by step instruction on how to do it including localize the image.
Another link that might help: IOS: launch image multiple language
What I did was go into my actual project folder and put the english version of my launch image into a folder called "Launch Image (English)". Then I put the version for the rest of the languages in a folder called "Launch Image (International)" (both images have the exact same name). Then I went into Xcode and attached both folders into the resources section. Then I highlighted each image, clicked on localization in the Utility pane, and for the english version I selected english obviously, and for the other version I selected spanish (then I put a check mark in the check box of each other language in the Utility pane). Then it worked!
Related
I have created a simple application for my Mac using Automator. I am trying to change its icon from the default robot icon, but anything I try does not work. I have tried copy-pasting the image I want using the Get Info technique, but that didn't work. I also converted the image I want as my icon to a .icns file and put it in the resources folder inside the package contents folder for the app. I also renamed that icon to AutomatorApplet.icns. This technique did not work either. Are there any other techniques I can try, or am I simply doing something wrong?
The copy-paste technique actually works. The one thing I realized I missed is to select the image. You need to hit command-a to "select all" before you can copy the image you want to use as your icon. Then to paste the image onto the app/file you want to have the image as an icon for, just select the item and hit command-i. The get info panel opens and you will need to click on the icon on the top left. Hit command-v and your new image should be used as an icon.
As in android, they can use any vector image formats. My designer gave my abc.ttf file which contains icons for the app. The interesting thing about TTF is, it is not stretched or pixelate while increasing the size. So plz help me to figure out, is there any way to use TTF or any other vector image format.
Thnks
Posted my solution at medium.
Refer SVG or TTF icons in iOS (Swift 4.0) without using any third party library.
Step 1: Get your ttf file from the designer or get it online. I am showing with fontAwesome icons.
Link where you get ttf file. : https://fontawesome.com/v4.7.0/
Download this and extract it. You will see the fonts folder in it. Go to fontawesome-webfont.ttf.
Step 2: Open this TTF file and install
After Installation
Step 3: Open to your iOS project, go to your storyboard/Xib file add an UILabel.
Step 4: Add/import TTF file (downloaded) to your project.
Step 5: Now in your attribute inspector, go fonts and choose custom and click on family, you will see a list of fonts.
Choose FontAwesome (or you ttf file name).
That is so easy man. :P
Wait your last step is remaining.
Step 6: (Last One): Open your font file, select icon which you want to use and copy it.
Paste in the text area of your UILable in your storyboard/Xib.
You can use any icon from this file and there is plenty of icons already available at https://fontawesome.com/cheatsheet?from=io. You just need to copy and paste in the text of your label.
Step 1, 2 and 3 are a one-time process for a project and if you want to use the same TTF file in another project as well skip step 1 and 2.
The same procedure goes with buttons.
You can use vector PDFs instead of images
Refer How to use vectors in Xcode
I have a button with image.How can I localize it, in order it to have another image on different language ?
Are you loading the image from a Storyboard or programmatically?
If programmatically, then you can localise the string of the file name and have different images for each localisation.
If your image is not in an xcassets you can localize it in the file inspector.
If you image is in an xcassets, you can include the language identifier in its name, or as #jdapps said, localize the image name in a strings file.
You can add localized names for your images to Localizable.strings file and use "NSLocalizedString(key: String, comment: String)" method to access it. Works great for me.
Select the “image” in the project navigator. Next, bring up the file inspector, and locate the localization section, in which you’ll see a button named “Localize…”. Click the button and you’ll be prompted for confirmation. Choose English and click the “Localize” button to confirm.
Switch back to the finder and local the project directory. You’ll find two folders: en.lproj and Base.lproj. Both folders are automatically generated by Xcode for localization. The en.lproj folder stores resource files for English localization,If you localise for french language too, then fr.lproj folder will be added and is for French localization. If you look into both folders, each one contains the image file. Download the French version of the cover image from here (or use whatever image you like). Copy the cover image just downloaded and replace the one in fr.lproj folder.
I download a third party icon font file, and I drag it into my project and check the target. Everything is OK except when I change the Application Language using English. It show me the origin character but the icon.
Then I println all of the font families, that I can't find the icon font in English, instead in Chinese.
I don't know what happen.
Add in application info plist file this :
I know how to localize storyboard elements like label, buttons etc. However, I faced a problem where I need to localize the images that were setup in a storyboard in the attribute inspector for the Image View.
Is there a way to localize those without setting those images up in the code, in the viewDidLoad method and calling setImage:[UIImage imageNamed: NSLocalizedString(...)]; ?
Any kind of help is highly appreciated!
I guess I figured it out...maybe not the ideal way of doing it but works for me...
Open image folder in your Project Navigator (panel).
When you click one of the images, on the right (Inspector panel) you'll see the button "Localize".
Clicking on that button gives you a pop-up asking if you want it to be the base (in my case I say yes).
So now in the inspector there're check boxes: Base, language 1, language 2 etc (language n - is the languages you added to your project in the localization settings).
So now if you put a check mark into one of the language check boxes, your image file will have a drop down arrow showing that it has some content inside. If you click that, you'll see how it expands showing the localized files with the name of the language in the () brackets.
However, at this point those files are all the same as the base. So now you need to substitute the base files with the localized ones.
If you right click on the file that needs to be localized, say myImage.png(German), open it in Finder, and replace that file with the right one. Important! The name of the file should stay the same!
I'll post the screenshots later, so it's all clear how to do it.
Using Xcode 9.2
you can achieve it easily like the following
1- From Assets
2- Then you will need to change the Direction option AND CHOOSE BOTH
xcode will allow you to add 3 more image for other language resource
3- add your needed image and use it in story board or from code as well