package gettext
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=a80408ff891ed22b5be7e8a5331f4b31e7b50dea482bff56abe73457aa379e5f
sha512=574530a0c0822b7e1d5772f1c58db92bb52c742432666deb1cc2291fbe603250fa61263df033eb88769c8d7e8bcbbd728c91379d0a5377cfe6026d83a9222fb8
Description
This library enables string translation in OCaml. The API is based on GNU gettext. It comes with a tool to extract strings which need to be translated from OCaml source files.
This enables OCaml program to output string in the native language of the user, if a corresponding translation file of the English strings is provided.
Published: 02 Oct 2019
README
OCaml-gettext - Internationalization library for OCaml (i18n)
Internationalization of a program means that the program have the possibility to handle different language. It can output messages which depend on the language of the user. Typically, if a program can output "bonjour" for a french user, and "hello" for an english user, this program is internationalized.
GNU gettext is one of the standard solutions for i18n. You just need to use special functions to translate strings. These functions are used when the program is running to do the translation and when compiling the program to extract the strings automatically. In ocaml-gettext these functions are "s_", "f_","sn_" and "fn_". They are both used to translate at runtime and to extract strings for translation.
ocaml-gettext provides enough service to build a internationalized program. It comes with :
a pure Ocaml implementation, based on Camomile,
an alternative implementation with a binding to GNU gettext library,
ocaml-gettext
a tool to extract strings from Ocaml source.
Installation
The recommended way to install ocaml-gettext is via the [opam package manager][opam]:
$ opam install ounit
Documentation
API documentation is available online.
Examples
Dev Dependencies (1)
-
ounit
with-test & > "2.0.8" & < "2.2.6"
Used by (2)
-
gettext-camomile
< "0.4.2"
-
gettext-stub
< "0.4.2"
Conflicts
None