package stog

  1. Overview
  2. Docs

Inernationalization

type lang_abbrev = string
type 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.

val french : lang_data
val english : lang_data
val register_lang : lang_abbrev -> lang_data -> unit
val 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.

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

Innovation. Community. Security.