13.4. Advanced Topics

If you wish to compile i18n applications or program i18n compliant applications, please read this section.

13.4.1. Compiling i18n Programs

Many FreeBSD Ports have been ported with i18n support. Some of them are marked with -i18n in the port name. These and many other programs have built in support for i18n and need no special consideration.

However, some applications such as MySQL need to be have the Makefile configured with the specific charset. This is usually done in the Makefile or done by passing a value to configure in the source.

13.4.2. Programming i18n Compliant Applications

To make your application more useful for speakers of other languages, we hope that you will program i18n compliant. The GNU gcc compiler, GUI Libraries like QT and GTK support i18n through special handling of strings. Making a program i18n compliant is very easy. It allows contributors to port your application to other languages quickly. Refer to library specific i18n documentation for more details.

To the contrary of common perception, i18n compliant code is easy to write. Usually, it only involves wrapping your strings with library specific functions. In addition, please be sure to allow for wide or multibyte characters support.

13.4.2.1. A Call to Unify the i18n effort

It has come to our attention that the individual i18n/l10n efforts for each country has been repeating each others' efforts. Many of us have been reinventing the wheel repeatedly and inefficiently. We hope that the various major groups in i18n could congregate into a group effort similar to the Core Team's responsibility.

Currently, we hope that, when you write or port i18n programs, you would send it out to each country's related FreeBSD mailing lists for testing. In the future, we hope to create applications that work in all the languages out-of-the-box without dirty hacks.

13.4.2.2. Perl and Python

Perl and Python have i18n and wide characters handling libraries. Please use them for i18n compliance.

In older FreeBSD versions, Perl may gives warning about not having a wide characters locale that is already installed in your system. You can set the environmental variable LD_PRELOAD to /usr/lib/libxpg4.so in your shell.

In sh-based shells:

    LD_PRELOAD=/usr/lib/libxpg4.so

In C-based shells:

    setenv LD_PRELOAD /usr/lib/libxpg4.so

For questions about FreeBSD, e-mail <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.