Struct native_windows_gui::Locale [−][src]
pub struct Locale { /* fields omitted */ }
Expand description
Represent a Windows locale. Can be used to fetch a lot of information regarding the locale.
Use Locale::user
to fetch the current user local or Local::system
to fetch the system default locale. Using the first one is recommended.
use native_windows_gui as nwg; let fr_locale = nwg::Locale::from_str("fr"); let en_us_locale = nwg::Locale::from_str("en-US"); let user_locale = nwg::Locale::user(); let locales: Vec<String> = nwg::Locale::all(); user_locale.display_name();
Implementations
Create a new local from a locale name. If you have a str, use from_str
instead.
Create a new local from a locale name. If you have a String, use new
instead.
Localized name of locale, eg “German (Germany)” in UI language
Display name (language + country/region usually) in English, eg “German (Germany)”
Display name in native locale language, eg “Deutsch (Deutschland)
Localized name of country/region, eg “Germany” in UI language
English name of country/region, eg “Germany”
Native name of country/region, eg “Deutschland”
country/region dialing code, example: en-US and en-CA return 1.
list item separator, eg “,” for “1,2,3,4”
Returns the measurement system (metric or imperial)
Returns the decimal separator, eg “.” for 1,234.00
Returns the thousand separator, eg “,” for 1,234.00
Returns the digit grouping, eg “3;0” for 1,000,000
Returns the number of fractional digits eg 2 for 1.00
Returns the number of leading zeros for decimal, 0 for .97, 1 for 0.97
Returns the negative number mode. See the documentation of NegativeNumberMode
Returns native digits for 0-9, eg “0123456789”
Returns the local monetary symbol, eg “$”
Returns the intl monetary symbol, eg “USD”
Returns the monetary decimal separator, eg “.” for 1,234.00
Returns the monetary thousand separator, eg “,” for 1,234.00
Returns the monetary digit grouping, eg “3;0” for 1,000,000
Returns the number local monetary digits eg 2 for $1.00
Returns the positive currency mode. See PositiveCurrency
Returns the negative positive currency mode. See NegativeCurrency
Returns the short date format string, eg “MM/dd/yyyy”
Returns the type of calendar with a bit more precision. Ex: Calendar::GregorianUs
Returns the first day of week specifier, 0-6, 0=Monday, 6=Sunday
Returns the first day of year specifier. See FirstDayOfYear
ISO abbreviated language name, eg “en”
ISO abbreviated country/region name, eg “US”
Returns the english name of currency, eg “Euro”
Returns the native name of currency, eg “euro”
Return the localized month name. See month_name_abv
for the abbreviated version
Parameters: month_index: The month index. 1(January) to 12 (December) or 13 (if it exists).
Panics: This function will panic if month index in not in the 1-13 range.
Return the localized month name in an abbreviated version. See month_name
for the full version
Parameters: month_index: The month index. 1(January) to 12 (December) or 13 (if it exists).
Panics: This function will panic if month index in not in the 1-13 range.
Return the localized day name. See day_name_abv
for the abbreviated version
Parameters: day_index: The month index. 1(Monday) to 7 (Sunday)
Panics: This function will panic if month index in not in the 1-7 range.
Return the localized day name in an abbreviated version. See day_name
for the full version
Parameters: day_index: The month index. 1(Monday) to 7 (Sunday)
Panics: This function will panic if month index in not in the 1-7 range.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Locale
impl UnwindSafe for Locale
Blanket Implementations
Mutably borrows from an owned value. Read more