localizedString(forKey:value:table:localizations:)
Look up a localized string given a list of available languages.
Declaration
func localizedString(forKey key: String, value: String?, table tableName: String?, localizations: [Locale.Language]) -> StringParameters
- key:
The key for the localized string to retrieve.
- value:
A default value to return if a localized string for
keycannot be found. - tableName:
The name of the strings file to search. If
nil, the method uses tables inLocalizable.strings. - localizations:
An array of
Locale.Languagecorresponding to available localizations. Bundle compares the array against its available localizations, and uses the best result to retrieve the localized string. If empty, we treat it as no localization is available, and may return a fallback.
Return Value
A localized version of the string designated by key in table tableName.