Core Features
Get Translation String
Use the getStringWithCode: method to retrieve translated text:
objc
// Basic usage
NSString *result = [LoxilyLocalize getStringWithCode:@"110100"];
// With default value
NSString *result = [LoxilyLocalize getStringWithCode:@"110100"
defaultString:@"Default text"];Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | NSString | Yes | String ID, must match the localization file uploaded to Loxily Localize dashboard |
| defaultString | NSString | No | Default text (returned when not found) |
The code parameter for getStringWithCode: must match the string ID in the localization file uploaded to the Loxily Localize dashboard.
Switch Language
Use the updateLanguage: method to switch the target language:
objc
// Switch language
[LoxilyLocalize updateLanguage:@"en"];
// After switching, the SDK will:
// 1. Clear the in-memory cache for the current language
// 2. Download translation files for the new language
// 3. Load into memory
// 4. Trigger the initialization callback (if set)Supported Language Codes
The following language codes are supported:
ar- Arabiczh-cn- Chinese (Mainland)zh-tw- Chinese (Taiwan)zh-hans- Simplified Chineseen- Englishfr- Frenchde- Germanid- Indonesianit- Italianja- Japaneseko- Koreanpt- Portugueseru- Russianes- Spanishth- Thaitr- Turkishvi- Vietnamesefil- Filipinoms- Malayhi- Hindi