pub struct Locale { /* private fields */ }
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.

Return the identifier (ex: en-US) of every supported locales.

Return the current user locale

Return the current system locale

Return the name of the locale.

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 long date format string, eg “dddd, MMMM dd, yyyy”

Returns the time format string, eg “HH:mm:ss”

Returns the AM designator, eg “AM”

Returns the PM designator, eg “PM”

Returns the type of calendar. Ex: Calendar::Gregorian

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.