Localization

Struct Localization 

Source
pub struct Localization {
    pub bundle_development_region: Option<String>,
    pub bundle_localizations: Option<Vec<BundleLocalizations>>,
    pub bundle_allow_mixed_localizations: Option<bool>,
    pub caps_lock_language_switch_capable: Option<bool>,
}
Expand description

Localization

Fields§

§bundle_development_region: Option<String>

The default language and region for the bundle, as a language ID.

The system uses this key as the language if it can’t locate a resource for the user’s preferred language. The value should be a language ID that identifies a language, dialect, or script.

To distinguish between different languages and regional dialects, use a language designator with a region designator and a script designator separated by hyphens. To specify the English language as it’s used in the United Kingdom, use en-GB, where GB is the region designator. To represent Mandarin Chinese, spoken in Taiwan, and written in Traditional Chinese script, use zh-Hant-TW.

To specify a script, combine a language designator with a script designator separated by a hyphen, as in az-Arab for Azerbaijani in the Arabic script.

§Availability

  • iOS 2.0+
  • macOS 10.0+
  • tvOS 9.0+
  • watchOS 2.0+

§Framework

Core Foundation

§bundle_localizations: Option<Vec<BundleLocalizations>>

The localizations handled manually by your app.

§Availability

  • iOS 2.0+
  • macOS 10.0+
  • tvOS 9.0+
  • watchOS 2.0+

§Framework

Core Foundation

§bundle_allow_mixed_localizations: Option<bool>

A Boolean value that indicates whether the bundle supports the retrieval of localized strings from frameworks.

§Availability

  • iOS 2.0+
  • macOS 10.0+
  • tvOS 9.0+
  • watchOS 2.0+

§Framework

Core Foundation

§caps_lock_language_switch_capable: Option<bool>

A Boolean value that enables the Caps Lock key to switch between Latin and non-Latin input sources.

Latin input sources, such as ABC, U.S., and Vietnamese, output characters in Latin script. Non-Latin input sources, such as Bulgarian (Cyrillic script), Hindi (Devanagari script), and Urdu (Arabic script), output characters in scripts other than Latin.

After implementing the key, users can enable or disable this functionality by modifying the “Use Caps Lock to switch to and from” preference, which can be found in System Preferences > Keyboard > Input Sources.

§Availability

  • macOS 10.15+

§Framework

  • AppKit

Trait Implementations§

Source§

impl Clone for Localization

Source§

fn clone(&self) -> Localization

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Localization

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Localization

Source§

fn default() -> Localization

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Localization

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Localization

Source§

fn eq(&self, other: &Localization) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Localization

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Localization

Source§

impl StructuralPartialEq for Localization

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,