Contents

localizedString(forLanguageCode:)

Returns the localized string for the specified language code.

Declaration

func localizedString(forLanguageCode languageCode: String) -> String?

Parameters

  • languageCode:

    The language code indicating the language whose name you want.

Return Value

The localized name of the language.

Discussion

For example, calling this method on an American English (en_US) locale, passing "zh" for languageCode, produces the string "Chinese".

This method is equivalent to calling the displayName(forKey:value:) method passing the languageCode key and languageCode value.

See Also

Related Documentation

Getting Display Information About a Locale