Edit

Share via


NSBundle.LocalizedString Method

Definition

Overloads

LocalizedString(String, String, String, String)
Obsolete.
LocalizedString(String, String, String)
Obsolete.

A localized version of the string at the specified in the specified table.

LocalizedString(String, String)
Obsolete.

Retrieves the localized string for the key or, if not available, returns the key itself.

LocalizedString(String, String, String, String)

Caution

Use 'GetLocalizedString' instead.

[System.Obsolete("Use 'GetLocalizedString' instead.")]
public string LocalizedString (string key, string val, string table, string comment);
member this.LocalizedString : string * string * string * string -> string

Parameters

key
String
val
String
table
String
comment
String

Returns

Attributes

Applies to

LocalizedString(String, String, String)

Caution

Use 'GetLocalizedString' instead.

A localized version of the string at the specified in the specified table.

[System.Obsolete("Use 'GetLocalizedString' instead.")]
public virtual string LocalizedString (string key, string value, string table);
abstract member LocalizedString : string * string * string -> string
override this.LocalizedString : string * string * string -> string

Parameters

key
String

The key to lookup

This parameter can be null.

value
String

The value to return if the key is null, or the key was not found on the localization table.

This parameter can be null.

table
String

The table to search, if the value is null, this uses the Localizable.strings table.

This parameter can be null.

Returns

Attributes

Applies to

LocalizedString(String, String)

Caution

Use 'GetLocalizedString' instead.

Retrieves the localized string for the key or, if not available, returns the key itself.

[System.Obsolete("Use 'GetLocalizedString' instead.")]
public string LocalizedString (string key, string comment);
member this.LocalizedString : string * string -> string

Parameters

key
String

The key to the key-value to be localized.

comment
String

Hint to the application developer's translators.

Returns

The locale-appropriate string for the key. If there is no appropriate language-specific project directory or if the key is not found, returns the key.

Attributes

Remarks

String localization is done via "Localizable.strings" files within language-specific project directories (e.g., "es.lproj" for Spanish). The files are key-value text pairs separated by semicolons, with /* */ comments. These files should be included in the project as "BundleResource"s.

The language-specific project directories should be named according to ISO 639-1 or ISO 639-2. The application will use the directory appropriate to the application user's current system settings.

Applies to