package stog

  1. Overview
  2. Docs

Module Stog.IntlSource

Inernationalization

Sourcetype lang_abbrev = string
Sourcetype lang_data = {
  1. days : string array;
  2. months : string array;
  3. string_of_date : Types.date -> string;
  4. string_of_datetime : Types.date -> string;
}

Such a structure must be defined for each language to support.

Sourceval french : lang_data
Sourceval english : lang_data
Sourceval register_lang : lang_abbrev -> lang_data -> unit
Sourceval set_default_lang : lang_abbrev -> unit

Use the given language abbreviation (such as "fr") to set the default language. The language must have been registered previously (except for predefined "en" and "fr" languages) or else the Failure exception if raised.

Sourceval data_of_lang : lang_abbrev option -> lang_data
Sourceval get_month : lang_abbrev option -> int -> string
Sourceval string_of_date : lang_abbrev option -> Types.date -> string
Sourceval string_of_date_opt : lang_abbrev option -> Types.date option -> string
Sourceval string_of_datetime : lang_abbrev option -> Types.date -> string
Sourceval string_of_datetime_opt : lang_abbrev option -> Types.date option -> string
OCaml

Innovation. Community. Security.