r7 - 09 Dec 2008 - 22:45:45 - LinkUpdaterYou are here: OSAF >  Projects Web  >  ChandlerHome > DeveloperDocumentation > HowToWriteAParcelTutorial > InternationalizingYourParcel

This page is now obsolete

see InternationalizationProject for the latest i18n information

Internationalizing Your Parcel

Internationalization -- making the code easy to customize for a given locale -- involves many elements. One important piece is separating displayed text from code.

We have not yet figured out how we are doing the other pieces. Stay tuned.

Separating displayed text from code

The way we handle separating displayed text from code is to use a method named gettext, which is aliased to "_" to save keystrokes.

When python encounters _('text') or _("text"), the "_" method will use either text or the appropriate alternative for the current locale. (More on how to set a locale later. @@@)

If there is no alternative for text in the appropriate language, text will be used.

You do not need to worry about doing anything special to text that appears in your XRC file. Display text in your XRC file will automatically be examined for appropriate alternatives.

Localizing is more complicated -- the files that store the localized strings are kept centrally for Chandler, which means that OSAF needs to keep control of them. For the gritty details of how this is done, see DisplayTextI18N. Because letting people import parcels is important to OSAF, at some point Chandler will probably have to decentralize the localization strings, but OSAF isn't there yet.

External Resources

  • Python
    • http://www.python.org/sigs/i18n-sig/
    • http://www.python.org/doc/lib/module-locale.html
    • http://www.python.org/doc/lib/module-time.htm
    • http://www.egenix.com/products/python/mxBase/mxDateTime/
  • Mozilla
    • 16 Localizability Guidelines: http://www.mozilla.org/docs/refList/i18n/l12yGuidelines.html
    • Internationalization project: http://www.mozilla.org/projects/intl/
  • Open source i18n projects:
    • International Components for Unicode
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r7 < r6 < r5 < r4 < r3 | More topic actions
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.