:-). » Upon creating a new project, Xcode automatically generates files related to localization. The menu items contain the language name followed by the language ID in parentheses, as in German (de), Japanese (ja), and Arabic (ar). For example, the macros search the Localizable.stringsdict file for the %d file(s) remaining key first. For example, to prevent any edits to the nib file that would impact localized strings files, choose Reset Locking Controls followed by Localizable Properties. To submit a product bug or enhancement request, please visit the This whole localization system is not there to have us fall back to NSLocalizedString.. The value for this key is a dictionary that specifies the plural rule details. If we were to uncheck it, XCode would ask us for the specific locale that … The exported [Language ID].xliff file encodes the strings files in the standard XML Localization Interchange File Format (XLIFF). Sometimes users want to change the language inside an application, rather than changing on the whole device. Localizationの追加 Xcodeの「PROJECT」(TARGETではありません)「Info」の「Localization」の下に「 Use Base Internationalization 」がありチェックされていると思います。 Development Language はdefaultでEnglishが設定されています。 「+」から追加したい言語を選びます。 Xcode Use base internationalization and Auto Layout to internationalize your interface Localize other project resources as needed Preview your app when running and within Xcode. For example, add these lines to the InfoPlist.strings (French) file in the project navigator: If you localize the app name, use it in menu items and elsewhere in the user interface. Terms of Use | Privacy Policy | Updated: 2015-09-16. Now, let’s see how localization actually works in Xcode with an iOS app. Create a .stringsdict property list file and localize it for each language that has different plural rules. Translators should return a separate .xliff file for each language. Localization in Xcode can be done easily with the Strings format. Optionally, use the exportLanguage argument to export other localizations. The localized strings files are extracted from the corresponding [Language ID].xliff file. Copyright © 2015 Apple Inc. All Rights Reserved. setTitle (NSLocalizedString ("fly-here", comment: "Fly Here"), forState:. The NSLocalizedString macros search an existing .stringsdict file before the associated strings file that has the same filename prefix. This can save a lot of space in your app bundle and help reduce localization costs. When you import localizations, Xcode generates language-specific strings files for each .storyboard and .xib file. For example, if the development language is English, the filename is en.xliff. An overview of the elements involved in localizing your project. A sheet appears showing the differences between the imported XLIFF file and the existing resources in the project folder. You can switch the base localization on from your project settings. Xcode generates a Localizable.strings file from the NSLocalizedString macros in your code. Add a property list file to the project (choose File > New > File and select Property List from the sheet). Alternatively, you can use the xcodebuild command-line utility to export and import localizations. 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. For each language you select, Xcode saves an XLIFF file (a file with a language ID prefix and .xliff extension) to the location you specified in the Save As field. We’ll localize the app together and make it available in French. Xcode includes the human-readable copyright notice in the XLIFF file. Strings Management Prepare your strings for translation. Accepted Xcode's warning that the French storyboard will be discarded in favor of a .strings file, which appears in the Assistant editor. As I’ve mentioned, Secrets is translated in 11 different languages and has over 400 files related to localization. I'm a french guy located near Mtl, Canada. Continue developing your app while waiting for the translations. Be sure to start/stop the app. No more cluttered .stringsfiles in your project! New Localization Workflows in Xcode 10 The localization process in Xcode 10 has been updated to aid you through the lifecycle of exporting, importing, and testing localized content in your apps. Xcode saves the file to the location you specified with a .xliff extension. The .stringsdict file contains a collection of plural rules for each phrase. You can make other changes; for example, you can change the enabled state of a control or cell. Localizable.strings files have long housed the mappings of our string identifiers (frequently the native language representation of our strings) to display strings. In the project navigator, change the filename to Localizable.stringsdict and localize it in selected languages, as described in Adding Additional Resources You Want to Localize. However, Xcode does not allow to export an XLIFF of the base language. If my app supports two languages, why I would need a third (Base) localization? Search for keywords, tags ([Tag Name]), and users (user:appleseed). Notice that the Use Base Localization checkbox is checked by default. When a view is locked, you canât change some or all of its properties in the inspector or the project editor. We are going to create a small application called “Book Store”, which will displays the details of a book with a cover image, title, author and description. If you set a viewâs lock attribute, it sets the lock attribute for all its descendant views. The language ID for scripts or dialects uses subtags, as in pt-PT where pt is the code for Portuguese and PT is the code for Portugal. 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. For a complete list of the localizable Info.plist keys, read Locking Views. Reasoning. 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. So no use of Base here also? (Most third-party localization tools support this XLIFF file format.) Right now, we have the files located in a couple of different groups in the Xcode project: Figure 1: Localization Files. For example, if you select German and French from the language list, Xcode adds a de.xliff and fr.xliff file to the folder. The strings file has the same name as the .storyboard or .xib file but with the strings extension. For starters, while the .strings file format is the standard for Apple-oriented development, it’s not an industry standard. You can change user-visible strings and attributesâsuch as the size of the viewâbut canât change any other attributes of the view. This is simply because it's default for new projects in Xcode and it also supports storyboard localization etc. Gomen. Next, provide a localized .stringsdict file for all the supported languages that have different plural rules. Follow the steps in Testing Specific Languages and Regions to run the app in Xcode using different language settings. Localized .storyboard and .xib files now appear as groups in the project navigator. iphone - strings - xcode base internationalization . Normal) When we do, we could manually add the new key to all of the different language versions of our Localizable.strings file. Workaround for XCode base internationalization to support on-the-fly language change. If you’re working with outside localizers as part of your development process, you either need to find ones that u… For example, you may want to use different sets of image and audio files for different languages and dialects because of cultural differences. Sample XLIFF file: Even if you provide region-specific resources always provide a complete set of language-specific resources for all the languages you support. Having a base localization means that we don’t need to hassle our translators with our storyboards. For Localizable.strings, Base is not used, right? Refer to Table 6-1 for a description of the locking choices in this menu. Strings Management. Why would you work on something that you don't want to support? For example, use pt as the language ID for Portuguese as it is used in Brazil and pt-PT as the language ID for Portuguese as it is used in Portugal. The region-specific resource folders are searched before the language-specific resource folders. To make the app available in French, we’ll demonstrate how to localize: 1. the text in the sto… Bug Reporter To change the locking level of the nib file. In the sheet that appears, select a file with a .xliff extension and click Open. Base Internationalization. Right. Base internationalization in Xcode allows you to deal with one set of app content resources for different localizations, rather than several sets or resources (one set per localization.) Some languages have a single form, some have two categories, and others have three or more categories to represent quantities. If my storyboard has the actual English text in it (my app was just in English), I could set it as Base and use Localised Strings for other languages. When you are done internationalizing the appâs user interface and code, begin the localization process. The strings files don’t appear in the project navigator until you import localizations or add languages. Yes. Xcode doesnât add the strings files to the project until you import localizations later. To create the Localizable.strings file for each language, export and import localizations, as described in Exporting Localizations and Importing Localizations. The first time you export localizations, only the base internationalizationâthe .storyboard and .xib resource filesâexist in the project folder. After you import localizations, Xcode updates the project navigator to show the new language-specific resources. For the plural categories and rules for each language, see CLDR Language Plural Rules. See: インターナショナライゼーションとローカリゼーションのガイド, https://developer.apple.com/jp/documentation/. iPhone: Update Localizable.strings Dateien mit genstrings? When you export localizations, the development language strings are the source that is translated into multiple languages. For example, this key-value pair appears in the development language Localizable.strings from the previous code fragment: Alternatively, you can create the development language Localizable.strings file yourself, as described in Creating Strings Files for User-Facing Text in Your Code. If it is not found, the macros search the Localizable.strings file for the key. The App Store territories are listed in App Store territories. In the project navigator, select the project (not a target) and click Info. If you have an older project, enable base internationalization before continuing, as described in Enabling Base Internationalization. All postings and use of the content on this site are subject to the, Additional information about Search by keywords or tags, https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/Introduction/Introduction.html#//apple_ref/doc/uid/10000171i, https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/InternationalizingYourUserInterface/InternationalizingYourUserInterface.html#//apple_ref/doc/uid/10000171i-CH3-SW2, Apple Developer Forums Participation Agreement. To import localizations, enter this command in Terminal, replacing the and arguments: where refers to a single XLIFF file. 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. In the project navigator with the File inspector open, select the resource. 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. 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. The strings file contains key-value pairs that Xcode automatically generates from the text it finds in the corresponding .storyboard or .xib file. id Software's Quake 2 v3.21 with mission packs and Vulkan support (Windows, Linux, MacOS, FreeBSD, Raspberry Pi 4) - kondrak/vkQuake2 First you internationalize your user interface and code during development. To export multiple localizations for translation. The first time you import localizations, the base internationalization files change to a group containing the strings files in the project navigator. The files should use the language ID as the prefix. Add the language-specific plural rules to each .stringsdict file. With the XLIFF format you now have the possibility to group your .strings files into larger XLIFF language files. In the File inspector, under Localization, changed the French localization from "Interface Builder Cocoa Touch Storyboard" to "Localizable Strings." Repeat the process as needed, translating just the changes between each app revision. To export the development language translation. The next time you import localizations, the strings files are merged with your existing project files. Otherwise, why I would want to put "Settings" in my Base storyboard and then later set "Settings" = "Settings" for English? Before doing this, verify that the development language copyright notice in the Info.plist file is correct. For example, if you have a storyboard named MyStoryboard.storyboard, the generated strings file is named MyStoryboard.strings.