4.23 Localization (locale) support
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Localization (locale) support
          • locale_create/3
          • locale_destroy/1
          • locale_property/2
          • set_locale/1
          • current_locale/1
    • Packages
Availability:built-in
locale_create(-Locale, +Default, +Options)
Create a new locale object. Default is either an existing locale or a string that denotes the name of a locale provided by the system, such as "en_EN.UTF-8". The values read from the default locale can be modified using Options. Options provided are:
alias(+Atom)
Give the locale a name.
decimal_point(+Atom)
Specify the decimal point to use.
thousands_sep(+Atom)
Specify the string that delimits digit groups. Only effective is grouping is also specified.
grouping(+List)
Specify the grouping of digits. Groups are created from the right (least significant) digits, left of the decimal point. List is a list of integers, specifying the number of digits in each group, counting from the right. If the last element is repeat(Count), the remaining digits are grouped in groups of size Count. If the last element is a normal integer, digits further to the left are not grouped.

For example, the English locale uses

[ decimal_point('.'), thousands_sep(','), grouping([repeat(3)]) ]

Named locales exists until they are destroyed using locale_destroy/1 and they are no longer referenced. Unnamed locales are subject to (atom) garbage collection.