SlideShare a Scribd company logo
1 of 14
Download to read offline
Internationalizing Ubuntu apps David Planella @ Ubuntu App Developer Week, Mar 2014
> the concepts
(c) 2013 Canonical
Ubuntu internationalization 101
> Internationalization (i18n): “what developers do”
> Localization (l10n): “what translators do”
> Ubuntu app use Gettext technologies for internationalization
> Developers:
> mark text for translation using the i18n API in the SDK
> extract those translatable messages and expose them to translators
> build the finished translations and ship them in the app’s click package
> Translators:
> work in language teams to provide translations for a given language
> start their work once a call for translations is done
Internationalization concepts
(c) 2013 Canonical
Gettext glossary: POT files
> POT files or translation templates are textual files with .pot extensions
> Developers create the .pot file for translators, using gettext tools
> Each app has one template which is exposed to translators
> It consists of a standard header and contains msgid/msgid pairs
> msgid lines contain the original message
> msgstr contain the translated message but are empty in templates
> From one template, many translations are generated,
one for each language
#: ../NewEvent.qml:143
msgid "Add Location"
msgstr ""
Internationalization concepts
(c) 2013 Canonical
Gettext glossary: PO files
> PO files or translations are textual files with .po extension
> Translators or an online translation tool generate translation files
> Each app has as many translations as languages it’s available on
> They consist of a standard header and contains msgid/msgid pairs
> msgid lines contain the original message
> msgstr contain the translated message but are empty in templates
> Each translation file is named after LANGCODE.po, where LANGCODE
is a valid ISO 639 language code, with an optional country code
#: ../NewEvent.qml:143
msgid "Add Location"
msgstr "Afegeix una ubicació"
Internationalization concepts
(c) 2013 Canonical
Gettext glossary: MO files
> MO files are binary files that contain the translations loaded at runtime
> They are generated at build time from the .po files, using gettext tools
> Use msgfmt to generate .mo files from .po files
> They are efficient: fast binary hash table to look up translations
> MO files are shipped within the app’s click package, one per language
> They follow a standard layout when installed:
share/locale/$LANGCODE/LC_MESSAGES/$APPID.mo
> $LANGCODE is the ISO 639 language code (e.g. ‘de’ or ‘pt_BR’)
> $APPID is the app’s ID (e.g. com.ubuntu.developer.dplanella.myapp)
Internationalization concepts
> internationalizing apps
(c) 2013 Canonical
Use the SDK to mark messages for translation
> Make messages translatable using the i18n.tr() call:
property: i18n.tr(“Hello world”)
> At runtime, if there is an available translation for the user’s language
it will be loaded from the corresponding .mo file
> Use count arguments and the plural mode for plural messages
property string appleCount: i18n.tr("%1 apple",
"%1 apples",
applecount).arg(applecount)
> Documentation at http://developer.ubuntu.com/api/qml/sdk-1.0/Ubuntu.
Components.i18n/
Internationalizing apps
(c) 2013 Canonical
Use gettext and CMake to extract translatable messages
> Once marked for translation, messages need to be extracted from
the sources and put into the .pot file
> Use xgettext and a CMake rule for extraction,
and store the .pot file under a
po/ folder at the top of your source tree
> See the core apps code for an example,
Weather is a good choice
http://bazaar.launchpad.net/~ubuntu-weather-dev/ubuntu-weather-
app/trunk/view/head:/po/CMakeLists.txt
Internationalizing apps
(c) 2013 Canonical
Use msgfmt and CMake to build translations
> Once translators have done their work,
.po files need to be built and shipped
> Use xgettext and a CMake rule for build,
and ship translations in the click package
> See the core apps code for an example,
Weather is a good choice
http://bazaar.launchpad.net/~ubuntu-weather-dev/ubuntu-weather-
app/trunk/view/head:/po/CMakeLists.txt
Internationalizing apps
> localizing apps
(c) 2013 Canonical
Translators rock!, so be nice to them :)
> A community of translators will be ready to translate your app in
hundreds of languages
> They are kindly exposing your app to millions users in their language:
make their lifes easier to translate
> Add comments to your translatable messages
> Use an online translation service (Launchpad is a good choice)
> At least a week or two before release
> Send calls for translations on your social channels
> Send calls for translations on ubuntu-translators@lists.ubuntu.com
Localizing apps
demo
> Launchpad project i18n setup
Thank you
and
stay in touch!
> David Planella <david.planella@ubuntu.com>
> +DavidPlanella · @dplanella
> developer.ubuntu.com
> @ubuntuappdev
> gplus.to/ubuntuappdev
> facebook.com/ubuntuappdev

More Related Content

What's hot

Understanding how C program works
Understanding how C program worksUnderstanding how C program works
Understanding how C program works
MindBridgeTech
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
Jason Grimes
 

What's hot (20)

Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
 
GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
 
Understanding how C program works
Understanding how C program worksUnderstanding how C program works
Understanding how C program works
 
C language 1
C language 1C language 1
C language 1
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
 
GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh Maloth
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program execution
 
C++ basics
C++ basicsC++ basics
C++ basics
 
How to execute a C program
How to execute a C  program How to execute a C  program
How to execute a C program
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPC
 
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1
 
嵌入式Linux課程-GNU Toolchain
嵌入式Linux課程-GNU Toolchain嵌入式Linux課程-GNU Toolchain
嵌入式Linux課程-GNU Toolchain
 
Windows batch scripting
Windows batch scriptingWindows batch scripting
Windows batch scripting
 
Windows script host
Windows script hostWindows script host
Windows script host
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
Web technology slideshare
Web technology slideshareWeb technology slideshare
Web technology slideshare
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 

Viewers also liked

Attestato-content-marketing
Attestato-content-marketingAttestato-content-marketing
Attestato-content-marketing
Emiliano Micheli
 
Finnováció 2011- Frusztráció-mentes online bankolás
Finnováció 2011- Frusztráció-mentes online bankolásFinnováció 2011- Frusztráció-mentes online bankolás
Finnováció 2011- Frusztráció-mentes online bankolás
Isobar Budapest
 

Viewers also liked (20)

Video Games in Our Life!
Video Games in Our Life!Video Games in Our Life!
Video Games in Our Life!
 
Позиционирование подрядчика
Позиционирование подрядчикаПозиционирование подрядчика
Позиционирование подрядчика
 
Bli kvitt møtehelvetet for det koster mer enn sykefraværet fra MyPocket.Academy
Bli kvitt møtehelvetet for det koster mer enn sykefraværet fra MyPocket.AcademyBli kvitt møtehelvetet for det koster mer enn sykefraværet fra MyPocket.Academy
Bli kvitt møtehelvetet for det koster mer enn sykefraværet fra MyPocket.Academy
 
Attestato-content-marketing
Attestato-content-marketingAttestato-content-marketing
Attestato-content-marketing
 
Three Colours
Three ColoursThree Colours
Three Colours
 
Darius Pralgauskas: Google Adwords valdymo perdavimas
Darius Pralgauskas: Google Adwords valdymo perdavimasDarius Pralgauskas: Google Adwords valdymo perdavimas
Darius Pralgauskas: Google Adwords valdymo perdavimas
 
Finnováció 2011- Frusztráció-mentes online bankolás
Finnováció 2011- Frusztráció-mentes online bankolásFinnováció 2011- Frusztráció-mentes online bankolás
Finnováció 2011- Frusztráció-mentes online bankolás
 
Biblnk
BiblnkBiblnk
Biblnk
 
Comunicació política: la importància d'una estratègia a la xarxa
Comunicació política: la importància d'una estratègia a la xarxaComunicació política: la importància d'una estratègia a la xarxa
Comunicació política: la importància d'una estratègia a la xarxa
 
Somemainonnan tehokurssi 02_2016
Somemainonnan tehokurssi 02_2016Somemainonnan tehokurssi 02_2016
Somemainonnan tehokurssi 02_2016
 
Cara Mudah "Hidupkan" Twitter by @PraktisiSosmed
Cara Mudah "Hidupkan" Twitter by @PraktisiSosmedCara Mudah "Hidupkan" Twitter by @PraktisiSosmed
Cara Mudah "Hidupkan" Twitter by @PraktisiSosmed
 
Fp
FpFp
Fp
 
6. બેરોજગારી અને રોજગારી, How to generate Employment.(Revolution In Life)
6. બેરોજગારી અને રોજગારી, How to generate Employment.(Revolution In Life)6. બેરોજગારી અને રોજગારી, How to generate Employment.(Revolution In Life)
6. બેરોજગારી અને રોજગારી, How to generate Employment.(Revolution In Life)
 
Generalsekretærfrokost 23.05.16
Generalsekretærfrokost 23.05.16Generalsekretærfrokost 23.05.16
Generalsekretærfrokost 23.05.16
 
Suuntaviitat-2013
Suuntaviitat-2013Suuntaviitat-2013
Suuntaviitat-2013
 
Oppiminen online 03112016
Oppiminen online 03112016Oppiminen online 03112016
Oppiminen online 03112016
 
SEO audit
SEO auditSEO audit
SEO audit
 
Hvordan kapitalisere på ditt intranett av Pia Fischer
Hvordan kapitalisere på ditt intranett av Pia FischerHvordan kapitalisere på ditt intranett av Pia Fischer
Hvordan kapitalisere på ditt intranett av Pia Fischer
 
eTwinning_2010_11_17_roskilde
eTwinning_2010_11_17_roskildeeTwinning_2010_11_17_roskilde
eTwinning_2010_11_17_roskilde
 
తెలుగు హల్లులు (Telugu Hallulu)
తెలుగు హల్లులు (Telugu Hallulu)తెలుగు హల్లులు (Telugu Hallulu)
తెలుగు హల్లులు (Telugu Hallulu)
 

Similar to Internationalizing Ubuntu apps

La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
Cma Mohd
 
Introduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic conceptsIntroduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic concepts
ssuserf86fba
 

Similar to Internationalizing Ubuntu apps (20)

La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
 
Introduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic conceptsIntroduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic concepts
 
Localization (l10n) - The Process
Localization (l10n) - The ProcessLocalization (l10n) - The Process
Localization (l10n) - The Process
 
INTRODUCTION TO C LANGUAGE.pptx
INTRODUCTION TO C LANGUAGE.pptxINTRODUCTION TO C LANGUAGE.pptx
INTRODUCTION TO C LANGUAGE.pptx
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
 
COMPILER DESIGN.docx
COMPILER DESIGN.docxCOMPILER DESIGN.docx
COMPILER DESIGN.docx
 
Compliers and interpreters
Compliers and interpretersCompliers and interpreters
Compliers and interpreters
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming
 
Autotools pratical training
Autotools pratical trainingAutotools pratical training
Autotools pratical training
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
Transpilers(Source-to-Source Compilers)
Transpilers(Source-to-Source Compilers)Transpilers(Source-to-Source Compilers)
Transpilers(Source-to-Source Compilers)
 
COMPILER DESIGN.pdf
COMPILER DESIGN.pdfCOMPILER DESIGN.pdf
COMPILER DESIGN.pdf
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kite
 
C programming
C programming C programming
C programming
 
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
 
Intoduction to c language
Intoduction to c languageIntoduction to c language
Intoduction to c language
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 

Internationalizing Ubuntu apps

  • 1. Internationalizing Ubuntu apps David Planella @ Ubuntu App Developer Week, Mar 2014
  • 3. (c) 2013 Canonical Ubuntu internationalization 101 > Internationalization (i18n): “what developers do” > Localization (l10n): “what translators do” > Ubuntu app use Gettext technologies for internationalization > Developers: > mark text for translation using the i18n API in the SDK > extract those translatable messages and expose them to translators > build the finished translations and ship them in the app’s click package > Translators: > work in language teams to provide translations for a given language > start their work once a call for translations is done Internationalization concepts
  • 4. (c) 2013 Canonical Gettext glossary: POT files > POT files or translation templates are textual files with .pot extensions > Developers create the .pot file for translators, using gettext tools > Each app has one template which is exposed to translators > It consists of a standard header and contains msgid/msgid pairs > msgid lines contain the original message > msgstr contain the translated message but are empty in templates > From one template, many translations are generated, one for each language #: ../NewEvent.qml:143 msgid "Add Location" msgstr "" Internationalization concepts
  • 5. (c) 2013 Canonical Gettext glossary: PO files > PO files or translations are textual files with .po extension > Translators or an online translation tool generate translation files > Each app has as many translations as languages it’s available on > They consist of a standard header and contains msgid/msgid pairs > msgid lines contain the original message > msgstr contain the translated message but are empty in templates > Each translation file is named after LANGCODE.po, where LANGCODE is a valid ISO 639 language code, with an optional country code #: ../NewEvent.qml:143 msgid "Add Location" msgstr "Afegeix una ubicació" Internationalization concepts
  • 6. (c) 2013 Canonical Gettext glossary: MO files > MO files are binary files that contain the translations loaded at runtime > They are generated at build time from the .po files, using gettext tools > Use msgfmt to generate .mo files from .po files > They are efficient: fast binary hash table to look up translations > MO files are shipped within the app’s click package, one per language > They follow a standard layout when installed: share/locale/$LANGCODE/LC_MESSAGES/$APPID.mo > $LANGCODE is the ISO 639 language code (e.g. ‘de’ or ‘pt_BR’) > $APPID is the app’s ID (e.g. com.ubuntu.developer.dplanella.myapp) Internationalization concepts
  • 8. (c) 2013 Canonical Use the SDK to mark messages for translation > Make messages translatable using the i18n.tr() call: property: i18n.tr(“Hello world”) > At runtime, if there is an available translation for the user’s language it will be loaded from the corresponding .mo file > Use count arguments and the plural mode for plural messages property string appleCount: i18n.tr("%1 apple", "%1 apples", applecount).arg(applecount) > Documentation at http://developer.ubuntu.com/api/qml/sdk-1.0/Ubuntu. Components.i18n/ Internationalizing apps
  • 9. (c) 2013 Canonical Use gettext and CMake to extract translatable messages > Once marked for translation, messages need to be extracted from the sources and put into the .pot file > Use xgettext and a CMake rule for extraction, and store the .pot file under a po/ folder at the top of your source tree > See the core apps code for an example, Weather is a good choice http://bazaar.launchpad.net/~ubuntu-weather-dev/ubuntu-weather- app/trunk/view/head:/po/CMakeLists.txt Internationalizing apps
  • 10. (c) 2013 Canonical Use msgfmt and CMake to build translations > Once translators have done their work, .po files need to be built and shipped > Use xgettext and a CMake rule for build, and ship translations in the click package > See the core apps code for an example, Weather is a good choice http://bazaar.launchpad.net/~ubuntu-weather-dev/ubuntu-weather- app/trunk/view/head:/po/CMakeLists.txt Internationalizing apps
  • 12. (c) 2013 Canonical Translators rock!, so be nice to them :) > A community of translators will be ready to translate your app in hundreds of languages > They are kindly exposing your app to millions users in their language: make their lifes easier to translate > Add comments to your translatable messages > Use an online translation service (Launchpad is a good choice) > At least a week or two before release > Send calls for translations on your social channels > Send calls for translations on ubuntu-translators@lists.ubuntu.com Localizing apps
  • 14. Thank you and stay in touch! > David Planella <david.planella@ubuntu.com> > +DavidPlanella · @dplanella > developer.ubuntu.com > @ubuntuappdev > gplus.to/ubuntuappdev > facebook.com/ubuntuappdev