The i18n package is a library of Delphi components, classes and procedures in purpose of assisting developers to fully internationalize Delphi applications in an easy manner, and to change the locale of the applications on the fly.

There are many software tools for localizing a Delphi application, but they mostly just provide support for translation of the user interface strings. However, the i18n package not only enables developers to select translatable properties and string constants/literals within the IDE but also takes care of plural forms, reading layout, formatting preferences, and calendar system of the target language.

You want your application be ready for right-to-left languages, but you do not know which language is right-to-left and even how it works. Don’t worry, the i18n package knows how to handle right-to-left languages. When the application’s locale changes, and whenever needed, the i18n package automatically mirrors the layout of the application’s forms according to the reading layout of the selected language. You do not need to write a single line of code or even modify it.

Delphi missed to support bi-directional layout for most common controls. The i18n package workarounds this limitation and mirrors the layout of page and tab controls, tree views, list views, header controls, and status bars whenever it is needed.

Although the Gregorian calendar is most used calendar in the world, but if your application only supports this calendar, it cannot be truly localized for all countries/regions. The i18n package knows which calendar system is used by which country/region, and automatically displays and requests date-time values in the appropriate calendar. You do not need to have knowledge about different calendars, because your code still sees a standard TDateTime value. The following major calendars are implemented in the i18n package:

  • The Gregorian Calendar
  • The Hebrew or Jewish Calendar (הלוח העברי)
  • The Hijri or Islamic Calendar (التقويم الهجري)
  • The Jalali or Persian Calendar (گاهشمار جلالی)
  • The Japanese Emperor Era Calendar
  • The Julian Calendar
  • The Korean Tangun Era Calendar
  • The Taiwan calendar
  • The Thai Buddhist Calendar

The i18n comes with some components to make the locale dependent tasks easier. Here are the list of components/controls that you will have after installation of the package:

  1. TLocalizer
    Provides the core functionality for localizing an application.
  2. TTranslator
    Maintains list of translatable strings for a form, frame, data module, and so on. This component also translates the user interface strings and handles bi-directional mirroring of the controls.
  3. TGoogleTranslator
    This is an interface to the online Google translation service for automatic text translation.
  4. TMessageDialog
    Displays a localizable and customizable message dialog.
  5. TInputQueryDialog
    Displays a localizable input dialog box that lets the user enter a string, double, or integer.
  6. TIntlDateTimeLabel
    A label control that displays a fully localizable TDateTime value on a form.
  7. TIntlMonthCalendar
    A month calendar control to display a fully localizable calendar on a form.
  8. TIntlDatePicker
    A control that is designed specifically for entering localized dates.
  9. TFlagImageList
    A special image list component that provides country flag icons.
  10. TImageLabel
    A label control that can include an image on its face.
  11. TCultureLabel
    A label control to display name and country flag of a culture (locale) on a form.
  12. TCultureBox
    A combo box control that represents a list of cultures (locales).
  13. TCultureListBox
    A list box control that represents a list of cultures (locales).
  14. TCultureCheckListBox
    A check list box control that represents a list of cultures (locales).
  15. TTerritoryLabel
    A label control that displays name and flag of a country/region on a form.
  16. TTerritoryBox
    A combo box control that represents a list of countries/regions.
  17. TTerritoryListBox
    A list box control that represents a list of countries/regions.
  18. TTerritoryCheckListBox
    A check list box control that represents a list of countries/regions.
  19. TCurrencyLabel
    A label control that displays name and country flag of a currency on a form.
  20. TCurrencyBox
    A combo box control that represents a list of currencies.
  21. TCurrencyListBox
    A list box control that represents a list of currencies.
  22. TCurrencyCheckListBox
    A check list box control that represents a list of currencies.
  23. TDBImageLabel
    A data-aware label control that displays value of a field plus a custom icon on a form.
  24. TDBCultureLabel
    A data-aware label control that displays value of a locale field.
  25. TDBCultureBox
    A data-aware combo box control that enable users to select value of a locale field from a list of cultures (locales).
  26. TDBCultureListBox
    A data-aware list box control that enable users to select value of a locale field from a list of cultures (locales).
  27. TDBTerritoryLabel
    A data-aware label control that displays value of a country/region field.
  28. TDBTerritoryBox
    A data-aware combo box control that enable users to select value of a country/region field from a list of territories.
  29. TDBTerritoryListBox
    A data-aware list box control that enable users to select value of a country/region field from a list of territories.
  30. TDBCurrencyLabel
    A data-aware label control that displays value of a currency symbol field.
  31. TDBCurrencyBox
    A data-aware combo box control that enable users to select value of a currency symbol field from a list of currencies.
  32. TDBCurrencyListBox
    A data-aware list box control that enable users to select value of a currency symbol field from a list of currencies.
  33. TDBIntlDateTimeLabel
    A data-aware label control to display localized value of a date-time field.
  34. TDBIntlDatePicker
    A data-aware control that enables the user to enter a localized date for a date field.

In addition to the components and classes that are implemented just for localization purposes, the i18n package has some other classes to:

  • Decode/encode JSON formatted strings.
  • Set formatted content of rich edit controls using BBCode styled tags.
  • Parse and evaluate expressions in C language syntax.
  • Parse Pascal codes to extract string literals and string constants.

The interface part of the i18n package is fully documented by XML comments. Besides the help file that is shipped with the package, you can hover mouse pointer over any data type, class or member of a class to see its description.

The i18n package is tested on Delphi 2009 and 2010 only. But it ought to work on Delphi XE as well.

Known Problems

In Delphi 2009, because of a few bugs in Controls standard unit, mirroring page and tab controls for right-to-left languages causes child controls of these controls go off the screen. Also, other common controls may show odd behavior when toggle the layout’s direction.

In Delphi 2010, changing BiDiMode of a common control may cause an AV exception in comctl32.dll. This exception is not because of the i18n package. Even without the i18n package, this exception is probable to raise.

Download

i18n Package (6.5 MiB, Last updated on January 25, 2014)Source code of the i18n package and its translation editor. The zip archive also contains the binary of the translation editor, the reference manual of the package, and various sample programs.

Operational In

  • Small Editor

    If you are looking for a NotePad replacement and more try Small Editor. Designed to be use as a daily editor for text plain files (TXT) Small Editor can recognize dozens of well know programming language syntax and offer to you a minimalist interface plenty of small big details and lot of useful characteristics.

  • Img Converter

    Image Converter is a small Windows program which allows you to convert images in a very easy way; just by drag and drop image files to the program main window. Image Converter recognizes up to 20 different input formats and can convert images to 16 different output formats.

  • Screen GIF

    Screen GIF allows you to grab an arbitrary screen area and save it directly as a GIF image. This is really useful for various purposes, since GIF images can be easily shared via the web.

  • HTML Compiler

    HTML Compiler is a program for Microsoft Windows that enables you to put an entire HTML application (including HTML, CSS, JavaScript, Images, etc.) into a standalone Windows application, which can be executed like any other Windows application.

    Using HTML Compiler and taking advantage of web technologies, you can create applications like Help and Tutorials, Interactive e-books, Presentations, Kiosks, Computer-based training (CBT), CD interfaces, Educational games, Sales/promotional materials, Tests and quizzes and more.

If you have a software using the i18n package, and you would like your product to be listed here, please post the link to your software’s homepage and a brief description about it on the miscellaneous section of the forum.