String.LocalizationValue
A reference to a localizable string, with optional string interpolation.
Declaration
struct LocalizationValueOverview
Use this type when the localization key is the localized string value in the development language. This type also supports creating localized strings that depend on a value you provide at runtime. For example, if your app’s strings catalog contains a localizable entry for "Hello, \(userName).", you create a localized string like the following:
let greeting = String(localized: "Hello, \(userName).")If you want to use an arbitary string as your localization key, use String initializers that take a StaticString and a defaultValue parameter, like init(localized:defaultValue:table:bundle:locale:comment:) and init(localized:defaultValue:options:table:bundle:locale:comment:).
If you need to provide localized strings to another process that might be using a different locale, initialize with a LocalizedStringResource, using init(localized:) or init(localized:options:).