building world-ready windows store apps
DESCRIPTION
Building world-ready Windows Store apps. Ben Riga Sr. Technical Evangelist, Windows 8 http://about.me/ben.riga 3-104. What we’ll cover in this session. Localization Language resolution Globalization Translation. Unprecedented reach and opportunity. Apps in:. Developers from :. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/1.jpg)
Building world-ready Windows Store appsBen RigaSr. Technical Evangelist, Windows 8http://about.me/ben.riga3-104
![Page 2: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/2.jpg)
LocalizationLanguage resolutionGlobalizationTranslation
What we’ll cover in this session
![Page 3: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/3.jpg)
Unprecedented reach and opportunity
100+languages
Apps in:
120+markets
Developers from:
80+ currencies
Payouts:
230+countries
Store in:
![Page 4: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/4.jpg)
To the developer• Code base identical
across all languages
• Separate the code from any UI text that must be translated
• Supports linguistic and cultural needs of all users
To the user• Content in my
language• Data formatted
correctly for my culture (dates, times, currency, etc.)
• Text input just works
What does world-readiness mean?
![Page 5: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/5.jpg)
What’s new in Windows 8?User provides list of preferred languagesWindows intelligently does the right thingA client-side resource-management system for
HTML/JavaScriptNo need to call a server every time you want a string
The same resource-management system supports all languagesC#, C++, JavaScript, Visual Basic
You don’t have to manually manage images for DPI or high-contrast changes
New tooling to help manage translations
![Page 6: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/6.jpg)
3 parts to building world-ready appsLocalizationGlobalizationTranslation(Testing)
![Page 7: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/7.jpg)
Localization
![Page 8: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/8.jpg)
Localizing an app
Set a default language
Separate your
resources
![Page 9: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/9.jpg)
File-based resource managementUseful for images, media, HTML, CSS, etc.Expensive to translate, so avoid if possible
Steps (HTML or XAML):• Create alternate file assets for different languages and DPI• Use simple file / folder naming conventions • Ensure that your elements are tagged correctly
![Page 10: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/10.jpg)
Naming resources using qualifiersNaming convention:• foldername/qualifiername-value_qualifiername-value/filename.qualifiername-
value_qualifiername-value.ext
• Images/en-US/homeregion-USA/logo.scale-100_contrast-white.png
becomes:• Images/logo
![Page 11: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/11.jpg)
Localizing a stringUseful for hard-coded strings in code
Steps:• Move strings from markup to resource file (resJSON or ResW)• Use ResourceLoader.getString() to retrieve the resource by
name
![Page 12: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/12.jpg)
Managing and retrieving strings in markupHTML or XAML
Steps• Move strings from markup to resource file• In XAML:• Add x:Uid attribute to elements
• In HTML:• WinJS.Resources.processAll • Mark resource references using data-win-res attribute
![Page 13: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/13.jpg)
Localizing your app’s presence in the systemYour app content is also represented in the Windows Store, on the Start screen, in search, and in your app’s splash screenYou start by localizing your app manifest
Steps:• Add strings to resource file• Add references to the app manifest using ms-resource URI
scheme
![Page 14: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/14.jpg)
Demo
File-based resource managementRetrieving a stringManaging localized strings in markupThe app manifest
![Page 15: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/15.jpg)
Finding theright language
![Page 16: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/16.jpg)
Users specify all their language preferences
![Page 17: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/17.jpg)
Apps specify list of localizations Typically Visual Studio will extract from the
resources (in the app manifest)
Languages listed are the languages displayed to users in the Windows Store
![Page 18: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/18.jpg)
Developers can also allow users to overrideEffectively overrides the top language of the listPersistent & expensiveRequires app to reloadNot for transient changes (e.g., logging)Windows.Globalization.ApplicationLanguages.primaryLanguageOverride
![Page 19: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/19.jpg)
Windows intelligently matchesApp-supportedlanguages
User language preferences
App's primary language override
App languages What the user sees in the app
English (GB) (default)German (Germany) English (GB) none English (GB)
UI: English (GB)
Dates/times/numbers: English (GB)
German (Germany) (default)French (France)Italian (Italy)
French (Austria) none French (Austria)UI: French (France) (fallback from French (Austria))
Dates/times/numbers: French (Austria)
English (US) (default)French (France)English (UK)
English (Canada)French (Canada)
none English (Canada)French (Canada)
UI: English (US) (fallback from English (Canada))
Dates/times/numbers: English (Canada)
![Page 20: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/20.jpg)
Windows intelligently matches - defaultApp-supportedlanguages
User language preferences
App's primary language override
App languages What the user sees in the app
Spanish (Spain) (default)Spanish (Mexico)Spanish (Latin America)Portuguese (Brazil)
English (US) none Spanish (Spain)UI: Spanish (Spain) Uses default because no fallback is available for English
Dates/times/numbers: Spanish (Spain)
![Page 21: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/21.jpg)
Windows intelligently matches - partialApp-supportedlanguages
User language preferences
App's primary language override
App languages What the user sees in the app
Spanish (Spain) (default)Catalan (partial)French (France)
CatalanFrench (France) none Catalan
French (France)
UI: Mostly Catalan and some French (France) because not all the strings are in Catalan
Dates/times/numbers: Catalan
![Page 22: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/22.jpg)
Windows intelligently matches - overrideApp-supportedlanguages
User language preferences
App's primary language override
App languages What the user sees in the app
English (UK) (default)French (France)German (Germany)
German (Germany)English (UK)
English (UK) (chosen by user in app's UI)
English (UK)German (Germany)
UI: English (UK) (language override)
Dates/times/numbers: English (UK)
![Page 23: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/23.jpg)
User and app languages• User-declared languages
– Windows.System.UserProfile.GlobalizationPreferences.Languages()
• App-declared languages– Windows.Globalization.ApplicationLanguages.ManifestLanguages()
• Resolved languages– Windows.Globalization.ApplicationLanguages.Languages()
![Page 24: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/24.jpg)
Globalization
![Page 25: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/25.jpg)
GlobalizationNumbers / currencyDate / time
CollationCalendar
![Page 26: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/26.jpg)
Number formatting and parsingWindows.Globalization.NumberFormatting• DecimalFormatter• PercentFormatter• PermilleFormatter• CurrencyFormatter
![Page 27: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/27.jpg)
Date/Time FormattingWindows.Globalization.DateTimeFormatting• DateTimeFormatter
Windows.Globalization• Calendar
![Page 28: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/28.jpg)
Demo
Formatting dates/times/numbers
![Page 29: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/29.jpg)
Translation
![Page 30: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/30.jpg)
TranslationVarious options• DIY
– Microsoft Language Portal (with Microsoft product glossaries)
– http://www.microsoft.com/Language/en-US/Default.aspx• Multilingual App Toolkit• Crowdsourcing• Professional third-party services
![Page 31: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/31.jpg)
Multilingual App ToolkitIntegration with Visual Studio IDE
add and manage translation filesPseudo language engine (Language: qps-ploc)
for in-house testing of localized apps Translation file export & import roundtrip
send and receive resources to friends, family, or a translator for review
XLIFF lightweight editor localization UI for editing translated stringstranslation suggestions from Microsoft Translator
![Page 32: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/32.jpg)
Demo
Multilingual App Toolkit
![Page 33: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/33.jpg)
Using Microsoft Translator• For custom workflows• Microsoft Translator APIs (Translate( ),
Detect( ), Speak())• Crowdsource to improve translations –
collaborative translation features of the API (AddTranslation, GetTranslation)
• Bonus: Use the same API to add translation functionality to your application, to provide a truly global experience
• http://www.MicrosoftTranslator.com/dev/
![Page 34: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/34.jpg)
Resources
![Page 35: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/35.jpg)
SessionsBuilding world-ready Windows Store apps
3-103 (HTML/CSS/JavaScript)3-104 (XAML)
![Page 36: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/36.jpg)
SamplesApplication resources and localization sampleDate and time formatting sampleNumber formatting and parsing sample
All links here:http://bit.ly/BenRiga-Build2012
![Page 37: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/37.jpg)
SitesMultilingual App Toolkit for Visual StudioMicrosoft Translator Developer SiteMicrosoft Language Portal
All links here:http://bit.ly/BenRiga-Build2012
![Page 38: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/38.jpg)
Q&A
Ben RigaSr. Technical Evangelist, Windows 8http://about.me/ben.riga
![Page 39: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/39.jpg)
• Develop: http://msdn.microsoft.com/en-US/windows/apps/br229512
• Design: http://design.windows.com/
• Samples: http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples
• Videos: http://channel9.msdn.com/Windows
Resources
Please submit session evals by using the Build Windows 8 appor at http://aka.ms/BuildSessions
![Page 40: Building world-ready Windows Store apps](https://reader035.vdocuments.net/reader035/viewer/2022062501/5681676e550346895ddc5895/html5/thumbnails/40.jpg)
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.