When you are done internationalizing the app’s user interface and code, begin the localization process. Export all the development language strings files that contain user-facing text to a standard XML Localization Interchange File Format (XLIFF). Submit the XLIFF file to a localization team for translation into multiple languages. Continue developing your app while waiting for the translations. Import the XLIFF translations into the project and test the app in each language you added. Repeat the process as needed, translating just the changes between each app revision. As necessary, perform additional localization steps yourself.
Choosing Languages
You can choose from more than 100 different languages and dialects designated by regions to localize your app. However, the more general you make your localized resources, the more regions you can support with a single set of resources. This can save a lot of space in your app bundle and help reduce localization costs. For example, if you don’t need to distinguish between different regions that use the English language, you can add English to support users in the United States, United Kingdom, and Australia. Even if you provide region-specific resources always provide a complete set of language-specific resources for all the languages you support.
When searching for resources, the bundle APIs try to find the best match between the languages the app supports and the user’s language and region settings. The region-specific resource folders are searched before the language-specific resource folders. For example, if you add English (United States), English (United Kingdom), and English (Australia) to your project, the bundle APIs search the appropriate region-specific folders first, followed by the English language folder. For more information about how the bundle APIs find localized resources, read The Bundle Search Pattern in Bundle Programming Guide.
If you are unsure about what languages to add, consider the primary languages used in the App Store territories you choose in App Store Connect to market your app. The App Store territories are listed in App Store territories.
Locking Views
In Interface Builder, lock views you don’t want to accidentally change while waiting for translations. When a view is locked, you can’t change some or all of its properties in the inspector or the project editor. You specify the set of properties to lock by choosing a locking level (see Table 6-1).
Aug 27, 2015 Yes i saw this in the terminal but at the begining i run app where in the dmg file. Then i run in the terminal because nothings happen. Now when i run app, app's icon appears mac os's dock for a while then same icon appear its near. When i move on the second icon, a tooltip that named 'Java ' was shown. After ten second both icons disappear.
You can set the lock attribute for a single view or the entire nib file. By default, views inherit their lock attribute from their parent view and top-level views inherit their lock attribute from the
.storyboard or .xib file. If you set a view’s lock attribute, it sets the lock attribute for all its descendant views.
To change the locking level of a view
For example, choose Localizable Properties to continue developing your app while waiting for a nib or strings file to be localized. Choose Non-localizable Properties if you are incorporating translations into a nib file and don’t want to make other changes inadvertently.
To change the locking level of the nib file
For example, to prevent any edits to the nib file that would impact localized strings files, choose Reset Locking Controls followed by Localizable Properties.
Exporting Localizations
Export the development language resources to an XLIFF file and submit it to a localization team for translation into multiple languages.
The first time you export localizations, only the base internationalization—the
.storyboard and .xib resource files—exist in the project folder. Xcode generates the strings files from your project files and includes them in the exported .xliff file. Xcode doesn’t add the strings files to the project until you import localizations later. The exported [Language ID].xliff file encodes the strings files in the standard XML Localization Interchange File Format (XLIFF). (Most third-party localization tools support this XLIFF file format.) For example, if the development language is English, the en.xliff file contains base internationalization strings files (one for each .storyboard and .xib file), a Localizable.strings file, and an InfoPlist.strings file. The source text in the strings files is in English.
Translators should return a separate
.xliff file for each language. The files should use the language ID as the prefix. For example, if you request en.xliff for English be translated into German and Russian, the returned files should be named de.xliff for German and ru.xliff for Russian. The individual .xliff files contain the actual translations.
The first step to localize your app is to export the development language or base localization for translation. Before doing this, verify that the development language copyright notice in the
Info.plist file is correct. Xcode includes the human-readable copyright notice in the XLIFF file. For a complete list of the localizable Info.plist keys, read Locking Views. Spinning color wheel on mac.
To export the development language translation
The next time you export localizations, optionally export the development language resources, specific language resources, or all language resources.
To export multiple localizations for translation
Importing Localizations
When you import localizations, Xcode adds the language and a set of localized strings files for the language to the project. For example, if you import
ru.xliff in the standard XML Localization Interchange File Format (XLIFF) that includes the target language attribute, the Russian language is added to the project. The first time you import localizations, the base internationalization files change to a group containing the strings files in the project navigator. Xcode stores the language-specific strings files in language folders. For example, Xcode creates a ru.lproj folder in the project folder and adds a localized copy of the Localizable.strings and InfoPlist.strings files to the ru.lproj folder. The localized strings files are extracted from the corresponding [Language ID].xliff file. The next time you import localizations, the strings files are merged with your existing project files.
To import localizations from translators
Verifying Your Steps
After you import localizations, Xcode updates the project navigator to show the new language-specific resources. Localized
.storyboard and .xib files now appear as groups in the project navigator. Click the disclosure triangle next to a .storyboard or .xib file to reveal the base resource and language-specific strings files.
Select a strings file to view and optionally, edit the contents. The strings file contains key-value pairs that Xcode automatically generates from the text it finds in the corresponding
.storyboard or .xib file. If you use NSLocalizedString macros in your code, as described in Separating User-Facing Text from Your Code, a Localizable.strings group also appears in the project navigator.
Another kind of strings file is
InfoPlist.strings , which you use for localizing app properties that are visible to users (such as the app’s name). For the keys you can localize in an InfoPlist.strings file, read Locking Views.
Exporting and Importing Localizations Using Command-Line Utilities
Alternatively, you can use the
xcodebuild command-line utility to export and import localizations.
To export localizations, enter this command in Terminal, replacing the
<dirpath> and <projectname> arguments:
The exported XLIFF files are placed in
<dirpath> . Optionally, use the exportLanguage argument to export other localizations.
To import localizations, enter this command in Terminal, replacing the
<filepath> and <projectname> arguments:
where
<filepath> refers to a single XLIFF file.
Adding Additional Resources You Want to Localize
You can explicitly add language-specific resource files to your project. For example, you may want to use different sets of image and audio files for different languages and dialects because of cultural differences. At runtime, the app searches the language-specific folder before the base folder to find a resource file, so you can add a resource to the
Base.lproj folder and then specific language folders as needed.
Note: If the language doesn’t appear in the Localizations section in the Info pane of your project, add the language before following these steps, as described in Using Base Internationalization.
To localize a resource
After localizing a resource, you can add it to additional languages using the File inspector.
To add localizations to a resource
Handling Noun Plurals and Units of Measurement
If a string contains a noun plural or units of measurement, provide alternate strings for languages that have different plural rules. To specify language plural rules that can’t be represented by key-value pairs in a strings file, use a
.stringsdict file, an XML property list with a .stringsdict file extension. Languages vary in how they handle plurals of nouns or units of measurement. Some languages have a single form, some have two categories, and others have three or more categories to represent quantities. If you display a formatted string containing a variable quantity, you can use one string in your code that is localized using plural rules specified in a .stringsdict file.
Similar to how you retrieve localized text from strings files, use
NSLocalizedString macros in your code to retrieve the format string for different plural forms from a .stringsdict file. Next, provide a localized .stringsdict file for all the supported languages that have different plural rules. The NSLocalizedString macros search an existing .stringsdict file before the associated strings file that has the same filename prefix. For example, the macros search the Localizable.stringsdict file for the %d file(s) remaining key first. If it is not found, the macros search the Localizable.strings file for the key. Therefore, only add .stringsdict files for languages that have different plural rules.
To create language plural rules
For a complete description of the
.stringsdict file properties, read Stringsdict File Format. For the plural categories and rules for each language, see CLDR Language Plural Rules.
Video:WWDC 2013 Making Your App World-Ready: Localization > Using stringsdict
Localizing the Information Property List Files
When you export localizations, Xcode includes an
InfoPlist.strings file for translation. However, this file contains properties about your app and company, so you may want to verify or translate this file yourself. This strings file allows you to optionally localize some property values in the information property list, such as the app name (bundle display name) and copyright notice.
Xcode automatically adds these keys to the
InfoPlist.strings file:
For a complete description of the information property list, read Information Property List Key Reference.
Localizing the App Name and Copyright Notice
To localize the app name and copyright notice, add values for the
CFBundleDisplayName and NSHumanReadableCopyright keys to the InfoPlist.strings file. For example, add these lines to the InfoPlist.strings (French) file in the project navigator:
Getting the Localized App Name
If you localize the app name, use it in menu items and elsewhere in the user interface. You can get the localized app name programmatically with the
CFBundleDisplayName key:
For Mac apps, the user can rename the app in the Finder, so use the
NSFileManager class to get the app name:
Adding Languages
Add languages to your project if you want to add language-specific resources, as described in Adding Additional Resources You Want to Localize, before importing localizations. (Xcode automatically adds languages to your project when importing localizations.) For example, add language-specific image and audio files to your project or test language-specific plural rules before you begin localizing all the strings files.
When Xcode adds a language to your project, it creates a separate language folder to store the language-specific resources. Xcode adds a strings file for each
.storyboard and .xib file in the Base.lproj folder to the language folder. The strings file has the same name as the .storyboard or .xib file but with the strings extension. For example, if you have a storyboard named MyStoryboard.storyboard , the generated strings file is named MyStoryboard.strings .
To add a language to a project
App.properties Not Found Terminal Mac OsApp.properties Not Found Terminal Mac 2017
Copyright © 2015 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2015-09-16
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |