system locale
1.0.0System locale and language discovery
Table of Contents
About System-Locale
This library retrieves locale information configured on the system. This is helpful if you want to write applications and libraries that display messages in the user's native language.
How To
Primarily you'll want to use the functions locale and language to retrieve the information. You can also setf them if you want to force a particular setting.
(system-locale:locale) ; => "en_GB.UTF-8"
(system-locale:language) ; => "en"
The functions discover-active-locales and discover-active-languages describe how the locale and language discovery is handled.
System Information
Definition Index
-
SYSTEM-LOCALE
- ORG.SHIRAKUMO.SYSTEM-LOCALE
No documentation provided.-
EXTERNAL SPECIAL-VARIABLE *FALLBACK-LOCALE*
The default fallback locale used if no system locale can be discovered. This is, by default, en_US.UTF-8. See LOCALE
-
EXTERNAL SPECIAL-VARIABLE *LANGUAGES*
-
EXTERNAL SPECIAL-VARIABLE *LOCALES*
-
EXTERNAL FUNCTION DISCOVER-ACTIVE-LANGUAGES
Attempts to discover user-preferred system languages. Returns a list of found language codes. It considers the following environment variables: - LANGUAGE In addition it will extract the language code from all locales returned by DISCOVER-ACTIVE-LOCALES. See DISCOVER-ACTIVE-LOCALES See LANGUAGES
-
EXTERNAL FUNCTION DISCOVER-ACTIVE-LOCALES
Attempts to discover user-preferred system locales. Returns a list of found locales. It considers the following environment variables: - LC_ALL - LC_MESSAGES - LANG On Windows, it also considers the following WINAPI calls: - GetUserDefaultLocaleName - GetSystemDefaultLocaleName See LOCALES
-
EXTERNAL FUNCTION LANGUAGE
- &REST
- SUPPORTED
Accessor to the user-preferred language. This returns the first matching item returned by LANGUAGES, or the language-code part of *FALLBACK-LOCALE* if no match by STRING-EQUAL is found. If the fallback language was returned, the secondary value is :FALLBACK. Setting this place will add the given language to the *LANGUAGES* list if it is not yet present, and otherwise move it to the front of the list. See LANGUAGES See *FALLBACK-LOCALE*
-
EXTERNAL FUNCTION (SETF LANGUAGE)
- LANGUAGE
No documentation provided. -
EXTERNAL FUNCTION LANGUAGES
- &KEY
- REDISCOVER
Accessor to the list of user-preferred languages. This may be NIL if no preferred languages have been found. If REDISCOVER is non-NIL, DISCOVER-ACTIVE-LANGUAGES is always called. Otherwise, if the *LANGUAGES* variable is bound, its value is returned instead. See *LANGUAGES* See DISCOVER-ACTIVE-LANGUAGES
-
EXTERNAL FUNCTION (SETF LANGUAGES)
- LANGUAGES
No documentation provided. -
EXTERNAL FUNCTION LOCALE
- &REST
- SUPPORTED
Accessor to the user-preferred locale. This returns the first matching item returned by LOCALES, or *FALLBACK-LOCALE* if no match by LOCALE-EQUAL is found. If the fallback locale was returned, the secondary value is :FALLBACK. Setting this place will add the given locale to the *LOCALES* list if it is not yet present, and otherwise move it to the front of the list. See LOCALE-EQUAL See LOCALES See *FALLBACK-LOCALE*
-
EXTERNAL FUNCTION (SETF LOCALE)
- LOCALE
No documentation provided. -
EXTERNAL FUNCTION LOCALE-CHARSET
- LOCALE
Returns the charset-code part of a locale. "en_US.UTF-8" => "UTF-8" "en_US" => NIL "en.UTF-8" => "UTF-8" "en" => NIL "_US.UTF-8" => "UTF-8" "_US" => NIL ".UTF-8" => "UTF-8
-
EXTERNAL FUNCTION LOCALE-EQUAL
- A
- B
Returns true if the two locales are equal. Equal means that all the locale parts that are given in both locales match. "en" "en_US" => T "en_GB" "_US" => NIL etc.
-
EXTERNAL FUNCTION LOCALE-LANGUAGE
- LOCALE
Returns the language-code part of a locale. "en_US.UTF-8" => "en" "en_US" => "en" "en.UTF-8" => "en" "en" => "en" "_US.UTF-8" => NIL "_US" => NIL ".UTF-8" => NIL
-
EXTERNAL FUNCTION LOCALE-REGION
- LOCALE
Returns the language region-code part of a locale. "en_US.UTF-8" => "US" "en_US" => "US" "en.UTF-8" => NIL "en" => NIL "_US.UTF-8" => "US" "_US" => "US" ".UTF-8" => NIL
-
EXTERNAL FUNCTION LOCALES
- &KEY
- REDISCOVER
Accessor to the list of user-preferred locales. This may be NIL if no preferred locales have been found. If REDISCOVER is non-NIL, DISCOVER-ACTIVE-LOCALES is always called. Otherwise, if the *LOCALES* variable is bound, its value is returned instead. See *LOCALES* See DISCOVER-ACTIVE-LOCALES
-
EXTERNAL FUNCTION (SETF LOCALES)
- LOCALES
No documentation provided.