init(_:table:locale:bundle:comment:)
Creates a localized string resource from a localization key and its bundle properties.
Declaration
init(_ keyAndValue: String.LocalizationValue, table: String? = nil, locale: Locale = .current, bundle: LocalizedStringResource.BundleDescription = .main, comment: StaticString? = nil)Parameters
- keyAndValue:
The key for an entry in the specified table.
- table:
The name of the table containing the key-value pairs. If not provided,
nil, or an empty string, this value defaults toLocalizable.strings. - locale:
The locale for the resource to use. By default, the resource uses Current.
- bundle:
A Bundledescription that indicates where to locate the table’s strings file. By default, the resource uses the main bundle.
- comment:
The comment to place above the key-value pair in the strings file. This parameter provides the translator with some context about the localized string’s presentation to the user.