Localization plugin for OCaml
  • OCaml 99.9%
  • Standard ML 0.1%
Find a file
2018-01-11 19:23:07 +01:00
example Update example 2017-12-15 19:56:28 +01:00
metaprintf Handle %*.*d properly 2017-12-18 18:08:18 +01:00
po Better handling of plurals 2017-12-14 22:48:16 +01:00
test Handle %*.*d properly 2017-12-18 18:08:18 +01:00
translations Update translation for checked manual reference 2018-01-11 19:23:07 +01:00
translator Better handling of plurals 2017-12-14 22:48:16 +01:00
xtract Track changes in i18n PR 2018-01-11 19:16:05 +01:00
.gitignore Improved parsing 2017-12-10 13:35:01 +01:00
babilim.opam
configure Fusion babilim and metaprintf 2017-12-10 02:47:24 +01:00
LICENSE Basic documentation 2017-12-11 09:54:05 +01:00
README.md Change links to patched compiler 2017-12-19 23:01:44 +01:00

Babilim is a prototype for localization plugins for the OCaml compiler.

This plugin currently requires a patch to the OCaml compiler to work. This patch is available at https://github.com/Octachron/ocaml/tree/i18n .

Once this patched compiler installed, babilim can be installed with opam pin add babilim https://github.com/Octachron/babilim.git.

The localization plugin can then be used with either ocamlopt

ocamlopt -plugin $(ocamlfind query babilim)/babilim.cmxs -x-lang ${available translation}

or ocamlc

ocamlc -plugin $(ocamlfind query babilim)/babilim.cma -x-lang fr ${available translation}

Available translations:

More translations are more than welcome, see the template file

Code structure of babilim

  • the xtract executable implements localized string extraction using the compiler-libs

  • the po library implements the parsing of po files

  • the metaprintf library provides a position-aware alternative to format string whic used the underlying Format formatting engine, dynamic parsers for both Format format string and the metaprintf variant, and some adaptator between the two format

  • the translator executable translates the po files into the internal binary format used by the babilim plugin