---
title: NSLocalizedStringFromTableInBundle
framework: foundation
role: symbol
role_heading: Macro
path: foundation/nslocalizedstringfromtableinbundle
---

# NSLocalizedStringFromTableInBundle

Returns a localized version of a string from the table and bundle that you specify, which Xcode autogenerates when exporting localizations.

## Declaration

```occ
#define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment)
```

## Parameters

- `key`: The key for a string in the specified table. note: Xcode can’t export localizations for strings whose key is a string variable, nil, or an empty string.
- `tbl`: The name of the table containing the key-value pairs. Also, the suffix for the strings file (a file with the .strings extension) to store the localized string. The default table in Localizable.strings is used when tableName is nil or an empty string.
- `bundle`: The bundle containing the table’s strings file. The main bundle is used when bundle is nil.
- `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.

## Return Value

Return Value The result of sending localizedString(forKey:value:table:) to bundle, passing the specified key and tableName.

## Discussion

Discussion Use this macro to automatically generate a strings file named [tableName].strings located in bundle from your code when exporting localizations from Xcode or the genstrings utility. You can specify Unicode characters in key using \\Uxxxx—see the -u option for the genstrings utility. The initial value for key in the strings file is key. To avoid collisions between words or phrases with multiple meanings, use a unique key for each use of the same phrase. Use the NSLocalizedStringWithDefaultValue macro to specify another value for key. For information about inserting plural nouns and units into localized strings, see Localizing strings that contain plurals. As of OS X 10.11 and iOS 9, Bundle is thread-safe. As such, you can safely call NSLocalizedStringFromTableInBundle from any execution context. important: The values for key, tableName, and comment must be string literal values. Xcode can read these values from source code to automatically create localization tables when exporting localizations, but it doesn’t resolve string variables. If you want to use string variables, manually create a strings file and use localizedString(forKey:value:table:) instead. For more information on strings files, see String Resources. tip: Break up long string values into consecutive string literals. NSLocalizedStringFromTableInBundle(     @"Did you know that venus flytraps have flowers"         @" atop very long stems?\nThe long stem keeps"         @" insects a safe distance away from their"         @" digestive leaves below.",     @"Localized",     [NSBundle mainBundle],     @"An interesting fact about venus flytraps shown"         @" on the loading screen.");

## See Also

### Related Documentation

- [Exporting localizations](xcode/exporting-localizations.md)
- [Importing localizations](xcode/importing-localizations.md)

### Localization

- [NSLocale](foundation/nslocale.md)
- [NSOrthography](foundation/nsorthography.md)
- [NSLocalizedString](foundation/nslocalizedstring.md)
- [NSLocalizedStringFromTable](foundation/nslocalizedstringfromtable.md)
- [NSLocalizedStringWithDefaultValue](foundation/nslocalizedstringwithdefaultvalue.md)
