/sintl

SchilliX' gettext functions and tools, combined into a portable package

Primary LanguageCOtherNOASSERTION

sintl - SchilliX Internationalization

This project repackages the catgets() functions and gettext() functions and utilities originally implemented in the OpenSolaris fork SchilliX into a portable library, sintl.
Furthermore, it aims at implementing the functionality proposed in the standardization draft of gettext in the Single UNIX Specification that was originally missing on SchilliX.
The project is still work in progress and should not be used in production.

Contained functions

  • catopen() - include/nl_types.h

  • catgets() - include/nl_types.h

  • catclose() - include/nl_types.h

  • bindtextdomain() - include/libintl.h

  • bind_textdomain_codeset() - include/libintl.h

  • dcgettext() - include/libintl.h

  • dcgettext_l() - include/libintl.h

  • dcngettext() - include/libintl.h

  • dcngettext_l() - include/libintl.h

  • dgettext() - include/libintl.h

  • dgettext_l() - include/libintl.h

  • dngettext() - include/libintl.h

  • dngettext_l() - include/libintl.h

  • gettext() - include/libintl.h

  • gettext_l() - include/libintl.h

  • ngettext() - include/libintl.h

  • ngettext_l() - include/libintl.h

Note that while the *_l() functions are always declared in the header, they are only linkable on platforms that either support the querylocale() (e.g. FreeBSD, OpenBSD, MacOSX) or [getlocalename_l() interfaces. Without these (or equivalent) functions, the additional locale_t parameters cannot be mapped to a locale name, and no messages object can be located.

Contained utilities

  • gettext
  • ngettext
  • msgfmt (msgfmt utility as specified in the SuS draft)
  • msgfmt_rev (the same as msgfmt, but outputs binary message catalogs with swapped endinanness)
  • smsgfmt ("Solaris Message Format")
  • xgettext

Building and Installing

sintl uses a CMake build system.
For building sintl, you need to install the following utilities:

After that, the project can be built as follows:

mkdir build
cd build
cmake ..
cmake --build .
sudo cmake --install . # --prefix $PREFIX

In the last step, you can use --prefix to install the sintl library, headers and binaries to a prefix other than / (e.g. /opt/sintl).
If you install sintl to a non-default prefix, make sure to include $PREFIX/bin in your PATH, $PREFIX/man in your MANPATH and use the compiler / linker flags -I$PREFIX/include and -L$PREFIX/lib when using the utilities or linking against the library.

Testing

Configure and build first.

cd build
ctest -V