#[repr(C)]pub struct NSLocale {
pub ptr: Id<Object>,
}
Expand description
The NSLocale
class provides information about the user’s locale and formatting preferences.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSLocale
impl NSLocale
Sourcepub fn locale_with_locale_identifier(string: &NSString) -> Self
pub fn locale_with_locale_identifier(string: &NSString) -> Self
Returns a locale initialized using the given locale identifier.
Sourcepub fn init_with_locale_identifier(
&mut self,
locale_identifier: &NSString,
) -> Self
pub fn init_with_locale_identifier( &mut self, locale_identifier: &NSString, ) -> Self
Initializes a locale using a given locale identifier.
Sourcepub fn init_with_coder(&mut self, coder: &NSCoder) -> Self
pub fn init_with_coder(&mut self, coder: &NSCoder) -> Self
Returns a locale initialized from data in the given unarchiver.
Sourcepub fn autoupdating_current_locale() -> NSLocale
pub fn autoupdating_current_locale() -> NSLocale
A locale which tracks the user’s current preferences.
Sourcepub fn current_locale() -> NSLocale
pub fn current_locale() -> NSLocale
A locale representing the user’s region settings at the time the property is read.
Sourcepub fn system_locale() -> NSLocale
pub fn system_locale() -> NSLocale
A locale representing the generic root values with little localization.
Sourcepub fn available_locale_identifiers() -> NSArray<NSString>
pub fn available_locale_identifiers() -> NSArray<NSString>
The list of locale identifiers available on the system.
Sourcepub fn iso_country_codes() -> NSArray<NSString>
pub fn iso_country_codes() -> NSArray<NSString>
The list of known country or region codes.
Sourcepub fn iso_language_codes() -> NSArray<NSString>
pub fn iso_language_codes() -> NSArray<NSString>
The list of known language codes.
Sourcepub fn iso_currency_codes() -> NSArray<NSString>
pub fn iso_currency_codes() -> NSArray<NSString>
The list of known currency codes.
Sourcepub fn common_isocurrency_codes() -> NSArray<NSString>
pub fn common_isocurrency_codes() -> NSArray<NSString>
A list of commonly encountered currency codes.
Sourcepub fn canonical_locale_identifier_from_string(string: &NSString) -> NSString
pub fn canonical_locale_identifier_from_string(string: &NSString) -> NSString
Returns the canonical identifier for a given locale identification string.
Sourcepub fn components_from_locale_identifier(
string: &NSString,
) -> NSDictionary<NSString, NSString>
pub fn components_from_locale_identifier( string: &NSString, ) -> NSDictionary<NSString, NSString>
Returns a dictionary that is the result of parsing a locale ID.
Sourcepub fn locale_identifier_from_components(
dict: &NSDictionary<NSString, NSString>,
) -> NSString
pub fn locale_identifier_from_components( dict: &NSDictionary<NSString, NSString>, ) -> NSString
Returns a locale identifier from the components specified in a given dictionary.
Sourcepub fn canonical_language_identifier_from_string(string: &NSString) -> NSString
pub fn canonical_language_identifier_from_string(string: &NSString) -> NSString
Returns a canonical language identifier by mapping an arbitrary locale identification string to the canonical identifier.
Sourcepub fn locale_identifier_from_windows_locale_code(lcid: u32) -> Option<NSString>
pub fn locale_identifier_from_windows_locale_code(lcid: u32) -> Option<NSString>
Returns a locale identifier from a Windows locale code.
Sourcepub fn windows_locale_code_from_locale_identifier(
locale_identifier: &NSString,
) -> u32
pub fn windows_locale_code_from_locale_identifier( locale_identifier: &NSString, ) -> u32
Returns a Window locale code from the locale identifier.
Sourcepub fn locale_identifier(&self) -> NSString
pub fn locale_identifier(&self) -> NSString
The identifier for the locale.
Sourcepub fn country_code(&self) -> Option<NSString>
pub fn country_code(&self) -> Option<NSString>
The country or region code for the locale.
Sourcepub fn language_code(&self) -> NSString
pub fn language_code(&self) -> NSString
The language code for the locale.
Sourcepub fn script_code(&self) -> Option<NSString>
pub fn script_code(&self) -> Option<NSString>
The script code for the locale.
Sourcepub fn variant_code(&self) -> Option<NSString>
pub fn variant_code(&self) -> Option<NSString>
The variant code for the locale.
Sourcepub fn exemplar_character_set(&self) -> NSCharacterSet
pub fn exemplar_character_set(&self) -> NSCharacterSet
The exemplar character set for the locale.
Sourcepub fn collation_identifier(&self) -> Option<NSString>
pub fn collation_identifier(&self) -> Option<NSString>
The collation identifier for the locale.
Sourcepub fn collator_identifier(&self) -> NSString
pub fn collator_identifier(&self) -> NSString
The collator identifier for the locale.
Sourcepub fn uses_metric_system(&self) -> bool
pub fn uses_metric_system(&self) -> bool
A Boolean value that indicates whether the locale uses the metric system.
Sourcepub fn decimal_separator(&self) -> NSString
pub fn decimal_separator(&self) -> NSString
The decimal separator for the locale.
Sourcepub fn grouping_separator(&self) -> NSString
pub fn grouping_separator(&self) -> NSString
The grouping separator for the locale.
Sourcepub fn currency_code(&self) -> Option<NSString>
pub fn currency_code(&self) -> Option<NSString>
The currency code for the locale.
Sourcepub fn currency_symbol(&self) -> NSString
pub fn currency_symbol(&self) -> NSString
The currency symbol for the locale.
Sourcepub fn calendar_identifier(&self) -> NSString
pub fn calendar_identifier(&self) -> NSString
The calendar identifier for the locale.
Sourcepub fn quotation_begin_delimiter(&self) -> NSString
pub fn quotation_begin_delimiter(&self) -> NSString
The begin quotation symbol for the locale.
Sourcepub fn quotation_end_delimiter(&self) -> NSString
pub fn quotation_end_delimiter(&self) -> NSString
The end quotation symbol for the locale.
Sourcepub fn alternate_quotation_begin_delimiter(&self) -> NSString
pub fn alternate_quotation_begin_delimiter(&self) -> NSString
The alternate begin quotation symbol for the locale.
Sourcepub fn alternate_quotation_end_delimiter(&self) -> NSString
pub fn alternate_quotation_end_delimiter(&self) -> NSString
The alternate end quotation symbol for the locale.
Sourcepub fn localized_string_for_locale_identifier(
&self,
locale_identifier: &NSString,
) -> NSString
pub fn localized_string_for_locale_identifier( &self, locale_identifier: &NSString, ) -> NSString
Returns the localized string for the specified locale identifier.
Sourcepub fn localized_string_for_country_code(
&self,
country_code: &NSString,
) -> Option<NSString>
pub fn localized_string_for_country_code( &self, country_code: &NSString, ) -> Option<NSString>
Returns the localized string for a country or region code.
Sourcepub fn localized_string_for_language_code(
&self,
language_code: &NSString,
) -> Option<NSString>
pub fn localized_string_for_language_code( &self, language_code: &NSString, ) -> Option<NSString>
Returns the localized string for the specified language code.
Sourcepub fn localized_string_for_script_code(
&self,
script_code: &NSString,
) -> Option<NSString>
pub fn localized_string_for_script_code( &self, script_code: &NSString, ) -> Option<NSString>
Returns the localized string for the specified script code.
Sourcepub fn localized_string_for_variant_code(
&self,
variant_code: &NSString,
) -> Option<NSString>
pub fn localized_string_for_variant_code( &self, variant_code: &NSString, ) -> Option<NSString>
Returns the localized string for the specified variant code.
Sourcepub fn localized_string_for_collation_identifier(
&self,
collation_identifier: &NSString,
) -> Option<NSString>
pub fn localized_string_for_collation_identifier( &self, collation_identifier: &NSString, ) -> Option<NSString>
Returns the localized string for the specified collation identifier.
Sourcepub fn localized_string_for_collator_identifier(
&self,
collator_identifier: &NSString,
) -> Option<NSString>
pub fn localized_string_for_collator_identifier( &self, collator_identifier: &NSString, ) -> Option<NSString>
Returns the localized string for the specified collator identifier.
Sourcepub fn localized_string_for_currency_code(
&self,
currency_code: &NSString,
) -> Option<NSString>
pub fn localized_string_for_currency_code( &self, currency_code: &NSString, ) -> Option<NSString>
Returns the localized string for the specified currency code.
Sourcepub fn localized_string_for_calendar_identifier(
&self,
calendar_identifier: &NSString,
) -> Option<NSString>
pub fn localized_string_for_calendar_identifier( &self, calendar_identifier: &NSString, ) -> Option<NSString>
Returns the localized string for the specified language code.
Sourcepub fn object_for_key(&self, key: NSLocaleKey) -> Option<id>
pub fn object_for_key(&self, key: NSLocaleKey) -> Option<id>
Returns the value of the component corresponding to the specified key.
Sourcepub fn display_name_for_key_value(
&self,
key: NSLocaleKey,
value: &NSString,
) -> Option<NSString>
pub fn display_name_for_key_value( &self, key: NSLocaleKey, value: &NSString, ) -> Option<NSString>
Returns the display name for the given locale component value.
Sourcepub fn preferred_languages() -> NSArray<NSString>
pub fn preferred_languages() -> NSArray<NSString>
An ordered list of the user’s preferred languages.
Sourcepub fn character_direction_for_language(
iso_language_code: NSString,
) -> LanguageDirection
pub fn character_direction_for_language( iso_language_code: NSString, ) -> LanguageDirection
Returns the direction of the sequence of characters in a line for the specified ISO language code.
Sourcepub fn line_direction_for_language(
iso_language_code: NSString,
) -> LanguageDirection
pub fn line_direction_for_language( iso_language_code: NSString, ) -> LanguageDirection
Returns the direction of the sequence of lines for the specified ISO language code.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.