Localize Asset Catalogs
Asked Answered
L

4

39

I know it's a new feature and this may not be possible, but I would like to be able to localize an Asset Catalog in different languages, to show a localized launch image. This was possible on XCode 4 simply localizing an image, but with an iOS7 app it not works. Do you know if that is possible?

Luthern answered 15/9, 2013 at 16:38 Comment(9)
It doesn't appear to be possible at present. You could try reporting a bug via Apple's bug reporter: developer.apple.com/bug-reportingLukewarm
I can't imagine having to deal with localizing images, just for a launch screen. I do not see Apple adding this as a feature, since it is not recommended to add text to an image, and your launch screen should be just your UI without any text.Unselfish
I would recommend the following:add separate assets to the catalog as necessary with a standard naming convention (imageAsset_en, imageAsset_fr, imageAsset_es, etc), create a small utility class which functions to get the correct image based upon the current language of the phone (provided you support it), and then load the images programmatically and put them into the image views (i.e. you would load an image named "imageAsset" and based upon localization it would load "imageAsset_en" for English, just make sure to have a default for fallback). It isn't a pretty solution, but it should work.Bertie
I can write up a more formal answer for that if you think it'll work for you.Bertie
Chad Splash images are loaded before applicationDidFinishLaunching, my question is about the localization of the popular "Default.png" launch image @Unselfish my UI is localized in 10 languages, it's just sad to see text and buttons that appear suddenly, a splash screen would make it more fluidLuthern
My bad, I missed that it was a launch image.Bertie
That's not sad, that's according to the guidelines: developer.apple.com/library/ios/documentation/userexperience/…Boots
@Obliviux That is the whole purpose of a splash screen, so when you start your application you do not see a blank black screen. You will see your UI, and it will appear to load faster. I would highly recommend reading the link provided above.Unselfish
I'm also facing this problem. It's likely that we will have this in future as its based on json file. meanwhile do report this as a bug in developer.apple.com/bug-reportingSilhouette
G
5

I went the classic way. Just use single localized images and set up your plist correctly. The easiest way is to use one asset catalog, set everything up. Then open the application bundle and copy the correctly named files + the correct info.plist entries. (And of course remove the assets catalog afterwards) Result looks like this:

Info-plist:

info plist keys

Launch images filenames:

launch images filenames

(I needed all iPad orientations/sizes + all portrait iphone sizes + 7.0 specific sizes)

Greenwald answered 7/2, 2014 at 15:0 Comment(3)
Where did you get the "correct info.plist" entries? In the image catalog, there is only meta data in json format.Gemstone
Docs are currently here: developer.apple.com/library/ios/documentation/general/Reference/…Gemstone
@Gemstone check the actual application bundle, that gets created after a build. There you will find the plist and the images.Greenwald
K
2

Asset Catalog assets and images localization is supported since Xcode 11.

Khalid answered 14/6, 2019 at 10:36 Comment(0)
C
1

From Apple's documentation, you need to set the UILaunchImageFile key to a custom launch image filename.

enter image description here

You then need to have localize that file.

enter image description here

And make sure that your Launch Image is not set to use an asset catalog.

enter image description here

Charry answered 28/11, 2013 at 21:56 Comment(1)
Not working: "Your binary is not optimized for iPhone 5 - - New iPhone apps and app updates submitted must support the 4-inch display on iPhone 5 and must include a launch image referenced in the Info.plist under UILaunchImages with a UILaunchImageSize value set to {320, 568}."Vanderpool
V
1

I have the same problem in XCode 6.0 and iOS 7 and 8. Don't use Images.xcassets for splash screen. Add the following key to Info.plist:

<key>UILaunchImages~ipad</key>
<array>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>7.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{768, 1024}</string>
    </dict>
</array>
Vanesavanessa answered 2/10, 2014 at 18:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.