• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
GNU Internationalization Presentation

GNU Internationalization Presentation



A brief talk I gave to a small group of developers introducing GNU gettext and various localization topics.

A brief talk I gave to a small group of developers introducing GNU gettext and various localization topics.



Total Views
Views on SlideShare
Embed Views



6 Embeds 29

http://www.agavemountain.com 12
http://www.linkedin.com 7
http://www.slideshare.net 6
http://sitebuilder.jimdo-dev15.diy.dlan.cinetic.de 2 1
http://s3.amazonaws.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

GNU Internationalization Presentation GNU Internationalization Presentation Presentation Transcript

  • GNU Internationalization and localization -Joe Turner 8 March 2007
  • Agenda
    • What is i18n, l10n, and a locale?
    • Linux and l10n
    • The GNU process
    • Programmers’ View of the Process
    • Translator’s View
    05/28/09 - Joe Turner
  • Internationalization (i18n)
    • Internationalization is the process of planning and implementing products and services so that they can easily be adapted to specific local languages and cultures, a process called localization .
    • Internationalization comes in several variants:
      • Monolingual internationalization - Enables the creation of localized versions of a product, where each localized version supports only its target locale. This is no longer sufficient for business requirements.
      • Internationalization for multilocalization - Supports localization and data processing for multiple locales, where the actual locale is selected on execution of the product or at runtime.
      • Multilingualization - Enables data processing and display in multiple languages and locales simultaneously, for example, mixing Chinese and Arabic text in a single document.
    05/28/09 - Joe Turner
  • Localization (L10n)
    • Localization is the process of adapting software for a particular country or region; The adaptation of a product, application or document content to meet the language, cultural, and other requirements of a specific target market.
    • Examples of Localization:
      • Translation of the user interface and documentation into a different language.
      • Altering some format fields in resource files according to the locale conventions, for example, changing a date format from mm/dd/yy to yy/mm/dd.
      • Adding code modules that implement locale-specific functionality, such as an input method editor for Japanese or a module that calculates Hebrew calendar dates.
    05/28/09 - Joe Turner
  • Locale
    • A locale is a set of parameters that defines the user's language, country and cultural rules.
    • A locale is a specific geographical, political, or cultural region. It is usually identified by a combination of language and country, for example, en_US represents the locale US English.
      • es is Spanish; es_MX is Mexican Spanish
      • pt is Portuguese, pt_BR is Brazilian Portuguese
      • en is English; en_US is US English
    05/28/09 - Joe Turner
  • Linux and L10n
    • The Linux l10n software architecture is based on the GNU “gettext” tool suite, together with a range of gettext compatible translator’s tools such as KBabel, PO-Edit, GTranslator and others.
    • Gettext allows identifying translatable strings in the Linux source code and extracting them into a format suitable for KBabel and the other l10n tools. This l10n architecture is shared by the majority of open-source projects, forming the de-facto standard in open-source related l10n.
    • The l10n “market” of gettext is organized as groups of volunteers from the target language countries. Most of these volunteers are university students who are using the software for their own purposes.
    05/28/09 - Joe Turner
  • 05/28/09 - Joe Turner Linux l10n Process
  • Linux l10n Process 05/28/09 - Joe Turner xgettext msgmerge msgfmt Professional Translator My_Application.mo Java Sources keys.pot C++ Sources es_MX.po fr.po pt_br.po en.po
  • GNU gettext
    • Included with glibc
    • Supports: C, C++, PHP, Java, Others
    • Utilities:
      • gettext
      • msgmerge
      • msgfmt
    05/28/09 - Joe Turner
  • Users’ View
    • $LANG environment variable points to native language:
      • $ echo $LANG
      • en_US.UTF-8
    • Applications set locale and pick up the translation files.
    05/28/09 - Joe Turner
  • Where are the files?
    • gettext works by expecting a locale directory where all of the translated strings are kept, in the following structure:
    • /locale (/usr/share/locale)
      • /en <-language code
        • /LC_MESSAGES
        • messages.po
        • messages.mo
    05/28/09 - Joe Turner
  • Programmers’ Role
    • Mark text that needs to be translated for each shared object
    • Example:
      • #include <libintl.h>
      • printf(gettext(“temperature :%d ”), temp);
    05/28/09 - Joe Turner
  • Special Cases
    • static const char *messages[] =
    • {
    • &quot;some very meaningful message&quot;,
    • &quot;and another one&quot;
    • };
    • const char *string;
    • ...
    • string = index > 1 ? &quot;a default message&quot; : messages[index]; fputs (string);
    • ...
    05/28/09 - Joe Turner
  • Special Cases
    • #define gettext_noop(String) (String)
    • static const char *messages[] = {
    • gettext_noop (&quot;some very meaningful message&quot;), gettext_noop (&quot;and another one&quot;)
    • };
    • const char *string;
    • ...
    • string = index > 1 ? gettext (&quot;a default message&quot;) : gettext (messages[index]);
    • fputs (string);
    • ...
    • }
    05/28/09 - Joe Turner
  • Plural Forms
    • English:
      • I have 1 apple.
      • I have 2 apples.
    • C/English:
      • if (n==1) printf(“I have %d apple.”, n)
      • else printf (“I have %d apples.”, n);
    • Other languages have multiple plural forms. Our solution: let the translator handle it.
      • printf( ngettext(“I have %d apple.”, “I have %d apples.”, n), n);
    05/28/09 - Joe Turner
  • Translators’ Role
    • Translate the files and return them to us.
    • Several free utilities to help
    05/28/09 - Joe Turner
  • 05/28/09 - Joe Turner
  • Java Support 05/28/09 - Joe Turner