[PDF] [PDF] i18n and L10n

adapting a software application for a specific language paraphrased from Wikipedia done once for each supported language often shortened to L10n because



Previous PDF Next PDF





[PDF] i18n and L10n

adapting a software application for a specific language paraphrased from Wikipedia done once for each supported language often shortened to L10n because



[PDF] L10n friendly test automation 30 - LocWorld

Plug-in localization-specific test scripts for additional I18n and L10n testing Capture Screenshots Hardcoded Strings UI Truncation I18N issues Adobe Inc



[PDF] Enseignement de la localisation en master traduction : poser les

print_lb print_lb=Imprimer Display today's date Imprimer Jeudi 27 octobre 2017 Internationalisation i18n Localisation l10n fr_FR Développeur Localisateur 



[PDF] Effective L10n Project Management - Project Open

L10n by translation agencies not specialized on l10n, “Friends Family” L10n providers, Glossary, Style Guides, Formal QC, L10n Architecture,



[PDF] How to L10n on transifex - Fedora

On Transifex Tian Shixiong Presented by Fedora Project Contributor How to L10n FUDCon APAC 2014 Thanks for the guys who make this happen in here



[PDF] SOFTWARE LOCALIZATION (L10N) QUALITY ASSURANCE FROM

Software L10n QA from the Tester's Perspective – Carola F Berger 2 1 Introduction In the following, I will discuss the localization process for software 



[PDF] Software Globalization and Adding Languages on Computers and

Localization (L10n): Adapting to specific languages/locales by translating text and adding locale-specific formatting to images and style sheets ○ Translation ( T9n): 

[PDF] l1b blanket visa rejection rate 2019

[PDF] l1b individual visa

[PDF] l1b rejection rate

[PDF] l1b visa rules

[PDF] l2 l1 com wiring

[PDF] l2 l1 loss

[PDF] l2 l1 norm inequality

[PDF] l2 l1 switch

[PDF] l2 penalty

[PDF] l2 regularization

[PDF] l2 regularization neural network

[PDF] l2 regularized logistic regression

[PDF] l2 work permit

[PDF] l29177 oil filter

[PDF] l90 bus

Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

i18n and L10n i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 -

Overview

Internationalization

implementing a software application so it can potentially be adapted to various languages without changes paraphrased from Wikipedia done once regardless of the number of languages to be supported often shortened to i18n because there are 18 letters between the i and n

Localization

adapting a software application for a specific language paraphrased from Wikipedia done once for each supported language often shortened to L10n because there are 10 letters between the l and n 2 i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 -

What AngularJS Provides

Applies different formatting to

currency amounts, dates, times and numbers based on locale

Provided by the number, currency and date filters

Steps to use

download a language-specific JavaScript file from extras i18n directory have names like angular-locale_langCode.js and angular-locale_langCode-countryCode.js add script tag for this JavaScript file to main HTML file add dependency on ngLocale module to main module

See http://docs.angularjs.org/guide/i18n

3 i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 -

AngularJS Limitation

Must select a single language and cannot change at runtime need a separate index.html file for each locale that includes a script tag for the property locale .js file

Workaround

Steps to use angular-dynamic-locale

download language-specific JavaScript files from extras i18n directory for each language to be supported into the subdirectory angular/i18n download tmhDynamicLocale.js add script tag for tmhDynamicLocale.js add dependency on 'tmh.dynamicLocale' module inject tmhDynamicLocale service where needed for initial language and each time the language needs to be changed, call tmhDynamicLocale.set(lang) where lang is a language code like en, en-us, es or fr 4 i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 -

Locale-based Text Translation

Not supported in AngularJS,

but it's easy to write a custom filter that does this

Example that follows provides this filter

and bundles use of angular-dynamic-locale 5 see locale directory at i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 -

My Locale Service & Filter ...

6 "Big Number": "N\\u00famero Grande", "Birthday": "Cumplea\\u00f1os", "Language": "Idioma", "Lunch Time": "La Hora del Almuerzo", "Price": "Precio" "Big Number": "Grande Nombre", "Birthday": "Le Jour de Naissance", "Language": "Langue", "Lunch Time": "L'heure du Dej\\u00e9uner", "Price": "Prix"

L10n/fr.jsonL10n/es.jsonL10n/en.json

i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 - ... My Locale Service & Filter ... 7

i18n and L10n Demo

{{bigNumber | number}}
{{price | currency}}
{{birthday | date}}
{{lunchTime | date:'h:mm a'}}
index.html if translation includes binding expressions, pass scope to the L10n filter with | L10n:this defines localeSvc service and L10n filter i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 - ... My Locale Service & Filter ... 8 (function () { 'use strict'; var app = angular.module('Demo', ['Locale']); app.controller('DemoCtrl', function ($scope, localeSvc) { $scope.$watch('lang', function (lang) { // causes digest cycle localeSvc.setLang(lang); $scope.lang = localeSvc.getDefaultLang(); $scope.bigNumber = 1234567.8901234; $scope.price = 1234.56; $scope.birthday = new Date(1961, 3, 16); var lunchTime = new Date(); lunchTime.setHours(11); lunchTime.setMinutes(30); $scope.lunchTime = lunchTime; demo.js not worrying about minimizing code in this example i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 - ... My Locale Service & Filter ... 9 (function () { 'use strict'; var module = angular.module('Locale', ['tmh.dynamicLocale']); var currentLang, translations = {}; module.factory('localeSvc', function ($http, $interpolate, tmhDynamicLocale) { var svc = {}; function loadTranslations(lang) { var url = 'L10n/' + lang + '.json'; $http.get(url, {ContentType: 'application/json'}). success(function (data) { translations[lang] = data; sessionStorage.translations = JSON.stringify(translations); error(function (err) { throw new Error('Failed to load language translations for "' + lang + '".'); svc.getDefaultLang = function () { var lang = navigator.language || navigator.userLanguage; return lang ? lang.split('-')[0] : 'en'; // default locale.js using sessionStorage to restore the language and translations when user refreshes browser after HTTP response is processed, a digest cycle is triggered better to retain country code and use a translation file with that in its name if it exists i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 - ... My Locale Service & Filter ... 10 svc.setLang = function (lang) { if (lang !== currentLang) { // Change i18n language. tmhDynamicLocale.set(lang); // causes digest cycle // Change L10n language. if (!translations[lang]) loadTranslations(lang); // causes digest cycle currentLang = sessionStorage.currentLang = lang; svc.translate = function (phrase, scope) { var t = translations[currentLang]; var result = t ? t[phrase] : null; if (scope && result) result = $interpolate(result)(scope); return result || phrase; return svc; }); // end of localeSvc locale.js using $interpolate to allow translations to contain binding expressions i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 - ... My Locale Service & Filter 11 module.filter('L10n', function (localeSvc) { return function (phrase, scope) { if (!currentLang) { // This occurs when the user refreshes a page. // Get the current language and translations // from sessionStorage. currentLang = sessionStorage.currentLang; translations = JSON.parse(sessionStorage.translations); return localeSvc.translate(phrase, scope); locale.js scope is an optional directive parameter that is only needed for translations that contain binding expressions i18n and L10n Copyright © 2013-2014 by Object Computing, Inc. (OCI)

All rights reserved

13 -

Summary

Relatively simple approach that has been

shown to work well in a fairly large app

Amazing that reevaluating

every visible label in every digest cycle is not a performance issue!

Other options

angular-translate - https://github.com/angular-translate/angular-translate more? 12quotesdbs_dbs14.pdfusesText_20