package gettext

  1. Overview
  2. Docs
Internationalization library (i18n)

Install

Dune Dependency

Authors

Maintainers

Sources

gettext-v0.4.2.tbz
sha256=8b672c7c521b8ac753c6a90925243cdd367dd5202e7c1e5d1a2507b11ad5d6a7
sha512=72bad53ce15ccc5113e4cfdc76b56c633926bb3702623964e006a99d21a758e7d47f0b9b67bebffe8b9a0c5f4d018cb7d4ae665568dfab52070ed355d5f9d31b

doc/gettext.extension/GettextPo/index.html

Module GettextPoSource

  • author Sylvain Le Gall
Sourceval empty_po : GettextTypes.po_content

empty_po : value representing an empty PO

Sourceval add_po_translation_no_domain : GettextTypes.po_content -> GettextTypes.po_commented_translation -> GettextTypes.po_content

add_po_translation_no_domain po (comment_lst,location_lst,translation) : add a translation to a corpus of already defined translation with no domain defined. If the translation already exist, they are merged concerning location, and follow these rules for the translation itself :

  • singular and singular : if there is an empty string ( "" ) in one of the translation, use the other translation,
  • plural and plural : if there is an empty string list ( "" ; "" ) in one of the translaiton, use the other translation,
  • singular and plural : merge into a plural form. There is checks during the merge that can raise PoInconsistentMerge :
  • for one singular string if the two plural strings differs
  • if there is some elements that differs (considering the special case of the empty string ) in the translation
Sourceval add_po_translation_domain : GettextTypes.textdomain -> GettextTypes.po_content -> GettextTypes.po_commented_translation -> GettextTypes.po_content

add_po_translation_domain po domain (comment_lst,location_lst,translation): add a translation to the already defined translation with the domain defined. See add_translation_no_domain for details.

Sourceval merge_po : GettextTypes.po_content -> GettextTypes.po_content -> GettextTypes.po_content

merge_po po1 po2 : merge two PO. The rule for merging are the same as defined in add_po_translation_no_domain. Can raise PoInconsistentMerge

Sourceval merge_pot : GettextTypes.po_content -> GettextTypes.po_content -> GettextTypes.po_content

merge_pot po pot : merge a PO with a POT. Only consider strings that exists in the pot. Always use location as defined in the POT. If a string is not found, use the translation provided in the POT. If a plural is found and a singular should be used, downgrade the plural to singular. If a singular is found and a plural should be used, upgrade singular to plural, using the strings provided in the POT for ending the translation.

Sourceval input_po : in_channel -> GettextTypes.po_content
Sourceval output_po : out_channel -> GettextTypes.po_content -> unit
Sourceval translation_of_po_translation : GettextTypes.po_translation -> GettextTypes.translation
OCaml

Innovation. Community. Security.