---
title: "init(_:table:locale:bundle:comment:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/localizedstringresource/init(_:table:locale:bundle:comment:)-69k32"
---

# init(_:table:locale:bundle:comment:)

Creates a localized string resource from a localization key and its bundle properties.

## Declaration

```swift
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 to Localizable.strings.
- `locale`: The locale for the resource to use. By default, the resource uses doc://com.apple.foundation/documentation/Foundation/Locale/current.
- `bundle`: A doc://com.apple.foundation/documentation/Foundation/LocalizedStringResource/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.
