gettext-header Documentation ============================ A modern C++26 header-only library providing GNU gettext-compatible internationalization (i18n), plus a C-compatible shared/static library and a ``msgfmt`` replacement tool. .. toctree:: :maxdepth: 2 :caption: Contents: overview usage api/library_root c_api tools sbom building Overview -------- See :doc:`overview` for project goals and architecture. Quick Start ----------- .. code-block:: cpp :caption: C++ header-only usage #include #include int main() { intl::bindtextdomain("myapp", "/usr/share/locale"); intl::textdomain("myapp"); // Translated if a catalog is loaded for the current locale std::cout << intl::gettext("Hello, world!") << std::endl; // Plural forms int n = 5; std::cout << intl::ngettext("file", "files", n) << std::endl; // Context-qualified std::cout << intl::pgettext("menu", "Open") << std::endl; } .. code-block:: c :caption: C API usage (link with -lintl) #include #include int main(void) { bindtextdomain("myapp", "/usr/share/locale"); textdomain("myapp"); printf("%s\n", gettext("Hello, world!")); return 0; } Indices and tables ================== * :ref:`genindex` * :ref:`search`