OCAML-GETTEXT(5)

πŸ’– OCAML-GETTEXT πŸ’– (section 5 of the manual, bestie)

okay so this is the manual page for ocaml-gettext β€” the common options that let you manage internationalisation in an OCaml program through the ocaml-gettext library. it's giving "make your program speak every language" energy ✨


✨ SYNOPSIS ✨

[--gettext-failsafe [{ignore} | {inform-stderr} | {raise-exception}]]
[--gettext-disable] [--gettext-domain-dir {textdomain} {dir}] [--gettext-dir {dir}] [--gettext-language {language}] [--gettext-codeset {codeset}]

🌸 DESCRIPTION 🌸

this section gives you the quick tea on the common options that programs using the ocaml-gettext library all share. ngl, they're the vibe check for your translations πŸ’…

  • --gettext-failsafe ignore β€” this defines how ocaml-gettext behaves when literally any error pops up while it's processing string translation. ignore is the default behaviour, bestie. the string you get back is the original string, untranslated. it's consistent, and it keeps your output usable even when it's not perfect. lowkey iconic of it.
  • --gettext-failsafe inform-stderr β€” same behaviour as ignore, except a message gets printed on stderr. so you still get your untranslated string, but it also tells on itself πŸ™ˆ
  • --gettext-failsafe raise-exception β€” this one is dramatic on purpose πŸ’€ it stops the program by raising an exception the moment an error is encountered. periodt.
  • --gettext-disable β€” disables any translation made by ocaml-gettext. every single translation returns the original string, untranslated. no cap.
  • --gettext-domain-dir textdomain dir β€” defines a dir to search for a specific domain. this is useful when your MO files are stored in a non standard directory, iykyk. πŸ“‚
  • --gettext-dir dir β€” adds a directory to search for MO files.
  • --gettext-language language β€” sets the language to use in the ocaml-gettext library. the language should be POSIX compliant. it should follow this convention: lang[_territory][.charset][@modifier]. the lang and territory should be two letters ISO code. charset should be a valid ISO character set (at least recognised by the underlying charset recoding routine). for example, valid languages are: fr_FR.ISO-8859-1@euro, de_DE.UTF-8. slay 🌈
  • --gettext-codeset codeset β€” sets the codeset for output.
⚠️ okay so listen up, because this part matters. users should be aware that these command line options apply only for strings after the initialisation of the library. this means that if the options initially guessed by ocaml-gettext don't match the command line provided, there should be some untranslated string, because these strings are translated before parsing options. this is particularly true for the usage message itself (--help): even if the strings are translated, they are translated before setting the correct option. it's giving "translated too early, bestie" 😭

some options (--gettext-codeset for example) are overrided internally for particular use. it should be required to always translate strings to UTF-8 in graphical user interface (because GTK2 requires it). so like, UTF-8 or nothing, fr fr πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

Sylvain Le Gall.


okay that's the whole page, bestie, you ate it 🫢 this one's from the ocaml-gettext source, dated 2008-04-29, and it lives at section OCAML-GETTEXT(5) in the manual β€” so go forth and internationalise, main character πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from