To reach out to the users in the global market, it is essential to provide your apps and services in many different languages. Making your apps and services ready for global distribution mainly consists of the following processes: internationalization (i18n) and localization (i10n). Internationalization is the process of preparing your app’s content for localization so that it can be adapted to different languages and regions. Localization is the process of adapting it to a specific language and locale.
Internationalization and localization are available on different programming languages. Check the programming language you use for building your app or service and follow the guides for the programming language that you are working on:
C/C++: for native apps and services
QML: for Qt/QML apps
There are a few things to keep in mind when you localize your apps or services for webOS Open Source Edition (OSE).
Write code for your apps and services using the provided internationalization (i18n) libraries. This page provides the links to external pages with detailed information on libraries and coding rules.
Prepare multi-language string resources in the guided formats. You can prepare string resources yourself, or use a localization tool to make string resources generated at build time.
Test your apps and services by iterating the localization process. This helps you identify changes to be translated or non-translated content at early stages. By means of pseudolocalization, you can test the internationalized apps and services with pseudolanguages even before localizing them.
Set up a communication channel with your translator. Since the translator will be working with XLIFF files for translation, it’s highly recommended that your translator be familiar with the XLIFF standard.
Locale identification in webOS OSE
Locales in webOS OSE follow the BCP 47 standard. A locale is represented as a language tag, typically in language-[script]-[region] format, where the language code is a required field. For example,
fr-FR: French - France
fr-CA: French - Canada
zh-Hant-HK: Chinese - Chinese Traditional - Hong Kong
For more information about BCP 47 and the language tag, refer to the following:
Internationalization is essentially the prerequisite for localizing your content. This means you must internationalize your code first. Internationalization structures your apps and services’ content for localization. This is accomplished by marking your text for translation and formatting locale-sensitive data with appropriate APIs provided by an international library for the programming language you’re working on.
Once you’re done with internationalization, it’s advisable to test your internationalized app or service with the prebuilt pseudolanguages. See Testing With Pseudolocalization for more information.
After you have internationalized your apps and services and tested them with pseudolocalization, your apps and services are ready to be localized.
You need to prepare string resources for different languages and locales. A string resource is a set of text strings for your apps and services. Creating string resources can be done either manually or by using a localization tool.
Please refer to the following guide for more information about applying localization: Applying Localization.
Testing With Pseudolocalization
Once you have internationalized your app, you can test the internationalized app by using pseudolocalization (or pseudo-localization) before actually localizing your app. It helps you detect localization issues even before actual translation data is updated.
The localization tool introduced in Applying Localization, the loctool, generates string resources for a set of pseudo locales (you do not need XLIFF files for these locales). A pseudo string is generated by processing a source string marked for translation during the internationalization process. For hard-coded strings, however, their pseudo strings are not generated.
The following describes how to generate pseudo strings with the loctool:
In the project.json configuration file, set the value of pseudoLocale to the pseudolocales you wish to generate. See Preparing a Configuration File for details.