CFBundle.GetLocalizedString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| GetLocalizedString(String, String, String) |
Gets a localized string. |
| GetLocalizedString(String, String, String, CultureInfo[]) |
Gets a localized string for a list of possible localizations. |
| GetLocalizedString(String, String, String, String[]) |
Gets a localized string for a list of possible localizations. |
GetLocalizedString(String, String, String)
Gets a localized string.
public string? GetLocalizedString(string key, string defaultValue, string? tableName = default);
member this.GetLocalizedString : string * string * string -> string
Parameters
- key
- String
The key of the localized string to return.
- defaultValue
- String
A default value if no localized string is found for the specified key.
- tableName
- String
The name of the strings file to look in. The default is the 'Localizable.strings' file.
Returns
A localized string for the key key in the table tableName.
Remarks
Returns a localized string for the current bundle.
Applies to
GetLocalizedString(String, String, String, CultureInfo[])
Gets a localized string for a list of possible localizations.
public string? GetLocalizedString(string key, string defaultValue, string tableName, params System.Globalization.CultureInfo[] localizations);
member this.GetLocalizedString : string * string * string * System.Globalization.CultureInfo[] -> string
Parameters
- key
- String
The key of the localized string to return.
- defaultValue
- String
A default value if no localized string is found for the specified key.
- tableName
- String
The name of the strings file to look in.
- localizations
- CultureInfo[]
An array of languages to determine which localized string to return.
Returns
A localized string for the key key in the table tableName.
Remarks
Returns the most suitable localized string for the current bundle.
Applies to
GetLocalizedString(String, String, String, String[])
Gets a localized string for a list of possible localizations.
public string? GetLocalizedString(string key, string? defaultValue, string? tableName, string[] localizations);
member this.GetLocalizedString : string * string * string * string[] -> string
Parameters
- key
- String
The key of the localized string to return.
- defaultValue
- String
A default value if no localized string is found for the specified key.
- tableName
- String
The name of the strings file to look in. Specify null to use the default 'Localizable.strings' file.
- localizations
- String[]
An array of BCP 47 language codes to determine which localized string to return.
Returns
A localized string for the key key in the table tableName.
Remarks
Returns the most suitable localized string for the current bundle.