Skip to content

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

ParameterTypeRequiredDescription
codeNSStringYesString ID, must match the localization file uploaded to Loxily Localize dashboard
defaultStringNSStringNoDefault 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 - Arabic
  • zh-cn - Chinese (Mainland)
  • zh-tw - Chinese (Taiwan)
  • zh-hans - Simplified Chinese
  • en - English
  • fr - French
  • de - German
  • id - Indonesian
  • it - Italian
  • ja - Japanese
  • ko - Korean
  • pt - Portuguese
  • ru - Russian
  • es - Spanish
  • th - Thai
  • tr - Turkish
  • vi - Vietnamese
  • fil - Filipino
  • ms - Malay
  • hi - Hindi