First, let's define the differences between these words.
Globalization
Writing Win32 Multilingual User Interface Applications is the most quoted article on its topic.
Globalization and Localization for Windows Phone
The CultureInfo class is used to create a globalized app.
Microsoft's globalized sample app show localization of the app bar and the app title appearing in the phone’s app list. The user selects a Locale (English, German or Spanish) to display date, time, and currency in the correct format for the selected locale.
WARNING: Each project is separately enabled for globalization.
DOWNLOAD AND INSTALL: Multilingual App Toolkit.exe (3.0 MB, English) is installed to extend Visual Studio 2012 with localization tools for building Metro style apps in additional languages by providing translation support, translation file management, and editor tools.
DO THIS:
Within your app's Tools menu, select "Enable Multilingual App Toolkit".
This makes HTML parsing to look for localization mark-up.
DO THIS: In Visual Studio open SAMPLE: Application resources and localization sample shows how to use application resources to separate localizable content from application code.
DO THIS: Edit the default.js file to include the WinJS Res.js toolkit in a script tag in HTML.
add an event handler for the DOMContentLoaded event that calls WinJS.Resources.processAll() to load resource files.
document.addEventListener("DOMContentLoaded", WinJS.Resources.processAll(), false);
processAll() scans the DOM for data-win-attribute and processes it to create the component. So it can be called any point after the DOM is completely loaded.
When an app launches, the sequence of events fired is:
DO THIS:
Set the default language as the fist in the list within Visual Studio:
right-click the project name, choose Properties.
REFERENCE: Quickstart: Using string resources (Windows Store apps using JavaScript and HTML)
Language Group | Language (Country) | Qualifier |
---|---|---|
Base | English (US) | en-US |
4 Asian | Chinese (Simplified) | zh-Hant |
Chinese (Traditional) | zh-Hans or zh-Hant-TW | |
Japanese (Japan) | jp-JP | |
Korean (Korea) | kr-KR | |
6 European | French (France) | fr-FR |
German (Germany) | de-DE | |
Spanish (Spain) | es-ES | |
Italian (Italy) | it-IT | |
Portugese (Brasil) | pr-BR | |
Russian (Russia) | ru-RU |
DO THIS:
Within Visual Studio, right-click on the solution to Add New Folder strings.
Under strings Add a New Folder named "en-US" -- the default language for use by translators.
Add one folder for each language.
DO THIS: Add > New Item... "Resources File (.resjson)"
WARNING: The generated sample contents is wrong. There should be a comma after all but the last item in the file.
DO THIS: With the Release Preview, only major languages are supported beyond English: 4 Asian and 6 European.
Language codes are BCP-47 language tags also used by XAML. It is based on IANA list of languages. This is why Chinese language codes are not zh-CN or zh-TW.
QUIZ:
In what format does Windows 8 store translation resources for localization?
a) Plain text
b) XML
c) JSON
d) UTF-8
REFERENCE: Globalizing your app (Windows Store apps using JavaScript and HTML)
Add attribute x:Uid to HTML element to be localized.
<button class="win-backbutton" data-win-res="{attributes: {'aria-label' : 'Back'}}" disabled type="button"></button>
to:
<button class="win-backbutton" data-win-res="{attributes: {'aria-label' : 'Back'}}" disabled type="button"></button>
But the sample uses this:
data-win-res="textContent: sample_hello">Hello World!</p>
data-win-res="textContent: sample_hello">Hello World!</p>
A resources.resjson file is within a folder for each language. The file's extension refers to resources (res) in JavaScript object notation (json) format. The file contains a single JavaScript object with a list of properties.
The name of each property is the name of a key that you can map to from a data-win-res attribute, and the value of the property is the localized value.
The editor edits .resjson (JavaScript) resource files, which are equivalent to .resw for XAML.
How to manage language and region (Windows Store apps using JavaScript and HTML)
How to and this note that unlike .NET desktop apps, Culture in WinRT is not based on the CultureInfo object
Resource files must be named Resources.resw within folder strings.
TOOL: The .NET Resource File Generator (Resgen.exe) can also be used to decompile satellite assemblies into .resw files. This is different than in .NET which has a base files for the neutral language (English) plus separate files for each language.
At compile time, the MakePRI utility combines all .resw files into a single package resource index (PRI) file containing resources for all languages, cultures, and scale factors. Remember this when reading run-time errors that refer to this file.
Visual Studio resource editors create and edit resources.
At run time, access to app resources are provided by the Windows.ApplicationModel.Resources.ResourceLoader class and types in the Windows.ApplicationModel.Resources.Core namespace.
.xlf files are referenced by Microsoft Translator to provide machine based translation from a cloud based service.
NLocalize.com
DO THIS: Use the Multilingual App Toolkit to generate XLIFF files from .resjson files. Create an XLIFF file for each language.
The Toolkit manages and synchronizes an app’s resources via .xlf files formatted in XLIFF (XML Localisation Interchange File Format) defined by industry group OASIS and well supported by some localization vendors and localization tools.
Rather than referring to settings of the user's local computer, change (override) language locale with app code:
var ns = Windows.ApplicationModel.Resources.Core; var rm = ns.ResourceManager; var context = rm.current.defaultContext; context.language = "fr";
DO THIS: If an app is localized, change the user's language within Control Panel > Clock, Language, and Region > Language.
Testing is needed to check if an app has really avoided several common issues:
Microsoft provides for this
SAMPLE: Number formatting and parsing sample
SAMPLE: Language font mapping sample
SAMPLE: Date and time formatting sample
SAMPLE: Calendar details and math sample
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Thank you! |