NSBundle: localizations property
The localizations property is all the languages the bundle supports.
Value
An array of strings, such as ['en', 'zh-Hans'].
- Read-only; assigning to it throws
TypeError. - These are exactly the languages written in
ios.languagesinnacre.config.json. When running the acceptance app on the iPhone Air simulator (iOS 27.2) (noios.languageswritten), it is['en'].
Examples
js
console.log(JSON.stringify(NSBundle.mainBundle.localizations));Result: Prints ["en"] when running the acceptance app on the iPhone Air simulator (iOS 27.2).
Corresponding iOS API
NSBundle.localizations.