(* Locale routines for ocaml Copyright (C) 2002-2003 Shawn Wagner This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) (** Locale manipulation. *) (** The types of locales *) type category = [ `LC_ALL | `LC_COLLATE | `LC_CTYPE | `LC_MESSAGES | `LC_MONETARY | `LC_NUMERIC | `LC_TIME ] (** Information pertaining to the [LC_NUMERIC] locale. *) type numeric_lconv = { decimal_point: string; thousands_sep: string; grouping: string; } type sign_pos = [ `SurroundBoth | `SignPrecedesBoth | `SignSucceedsBoth | `SignPrecedesCS | `SignSucceedsCS | `UnknownOrder ] (** Information pertaining to the [`LC_MONETARY] locale. *) type monetary_lconv = { int_curr_symbol: string; currency_symbol: string; decimal_point: string; thousands_sep: string; grouping: string; positive_sign: string; negative_sign: string; int_frac_digits: int; frac_digits: int; p_cs_precedes: bool; p_sep_by_space: bool; n_cs_precedes: bool; n_sep_by_space: bool; p_sign_posn: sign_pos; n_sign_posn: sign_pos; } (** If a new locale name is not provided, just return the [Some name] of the current locale for the category. An empty name sets the locale based on environment variables. Returns [None] when setting the locale fails. *) val set: ?name:string -> category -> string option (** Set the locale based on environment variables *) val set_from_env : category -> string option (** Get the current locale for a category *) val get : category -> string (** Return the settings for the current [`LC_NUMERIC] locale. *) val numeric_info: unit -> numeric_lconv (** Return the settings for the current [`LC_MONETARY] locale. *) val monetary_info: unit -> monetary_lconv