Download presentation
Presentation is loading. Please wait.
Published byJoshua Gaines Modified over 6 years ago
1
Globalizing Your Software By Parag Nemade Fedora Contributor
2
Agenda Introduction Internationalization Localization C – Example
Python – Example
3
Introduction Globalization (G11N) is the process to globalize your work like software or business processes or any other thing that you want all world to understand and use it for their need in their own native language. For software, it is the process of adding internationalization (I18N) and localization (L10N) into your source code.
4
Internationalization
Help to uniformly work your software across multiple regions. It includes adding i18n support in your code which will enable string entries for translators. Code to handle all international support without breaking core software functionality Should not create problem for data storage and display Help to set user locale settings such as date, number, currency, sorting, paper size. Users can input in their own language preferences.
5
Localization Translators to provide correct meaningful translations. (Mostly English to other language) Software will be available in additional languages not just only in English. Sometimes use minimal text compared to actual translations text to accommodate it on Labels, buttons. GUI messages, Documentation, websites, Marketing brochures are translated.
6
Code Flow for G11N Source Code Source Code Source Code Source Code
I18N L10N G11N
7
Internationalization
General G11N Workflow Internationalization Globalized Product/Software Product/Software Localization
8
Advantages No overlapping of translated strings over adjacent widgets, prevent re-translation For translators, it will be easy to just use single file like po format No need for duplicate strings translation, all are picked uniquely in pot file
9
Disadvantages Many places of messages in source code need to be modified to add g11n Extra time need to spent on testing i18n support Data encoding conversions Rendering of text (Character reordering, conjuncts) Text message length on UI widgets (auto-expansion, more space between adjacent widgets) Extra time need to spent on testing l10n support Translations text need to be minimized.
10
C – Example (Basic) #include <libintl.h>
#include <locale.h> #include <stdio.h> #define _(X) gettext(X) int main(void) { setlocale(LC_ALL,""); bindtextdomain (“helloworld”, “.”); textdomain (“helloworld”); printf(_("Hello World!!\n")); return 0; }
11
C – Example (autotools)
#include <config.h> #include <libintl.h> #include <locale.h> #include <stdio.h> #define _(X) gettext(X) int main(void) { setlocale(LC_ALL,""); #if ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); textdomain (GETTEXT_PACKAGE); #endif printf(_("Hello World!!\n")); return 0; }
12
C++ - Example #include <config.h> #include <libintl.h>
#include <locale.h> #include <iostream> int main (){ setlocale(LC_ALL, ""); #if ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); textdomain (GETTEXT_PACKAGE); #endif std::cout << gettext("Hello world!!") << std::endl; }
13
Python - Example import gettext
gettext.bindtextdomain('hello-py', '.') gettext.textdomain('hello-py') _ = gettext.gettext print _('Hello World!!')
14
G11N references Wiki → https://fedoraproject.org/wiki/G11N
I18N → L10N → FLTG → Zanata →
15
Any Questions?
16
Thanks pnemade@fedoraproject.org #fedora-g11n on Freenode server
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.