Supported Languages
The SDK supports the following language codes:Setting a Fixed Language
Use thefixedLanguage metadata parameter to set a specific language for the SDK:
Swift
Objective-C
Device Language Detection
By default (whenfixedLanguage is not specified), the SDK automatically detects and uses the device’s language setting if it’s supported. If the device language is not supported, the SDK falls back to English.
Language Selection Examples
Example 1: User-Selected Language
Example 2: Region-Based Language
Example 3: Multi-Language Support with Picker
Storing Language Preferences
Combined with Other Metadata
You can combinefixedLanguage with other metadata parameters:
Localization Best Practices
- User Choice: Allow users to select their preferred language in your app settings
- Persistence: Store language preferences using UserDefaults or a similar mechanism
- Regional Defaults: Consider using device locale to suggest an appropriate language
- Fallback: Always have English as a fallback for unsupported languages
- Testing: Test your app with different language settings to ensure proper localization
- Consistency: Use the same language code throughout your app and MetaMap integration
Language Code Validation
The SDK will automatically fall back to English if an unsupported language code is provided or if the device language is not in the supported list.