Localization
iOS uses the system default behavior for localizing user experience. To enable supported language, your application must provide that localization too. Otherwise, the localization will fall back to English.
Info
For additional information on how you can localize your iOS Application, please see the official Apple Documentation.
Changing Localization
To change existing localization, you can utilize the localization hook localizationHandler
provided by the Document Reader SDK. This closure is called every time a string is requested.
To see all the localization keys, look up the RegulaSDK.strings
file at DocumentReader.xcframework/ios-arm64/DocumentReader.framework/en.lproj/RegulaSDK.strings
.
Here is an example of how you can add your own CustomLocalization.strings
file and override any existing localization provided by the Document Reader SDK:
DocReader.shared.localizationHandler = { localizationKey in
// This will look up localization in `CustomLocalization.strings`.
let result = NSLocalizedString(localizationKey, tableName: "CustomLocalization", comment: "")
// Localization found in CustomLocalization.
if result != localizationKey {
return result
}
// By returning nil we fallback to the default localization provided by SDK.
return nil
}
Danger
Avoid changing the iOS system language (by using the AppleLanguages pref key) from within your application. This goes against the basic iOS user model for switching languages in the Settings app and uses a preference key that is not documented. At some point in the future, the key name may change and that would break your application.
You can have a look at the example of how we did implement this in our app that is available on App Store: Menu -> Settings -> Advanced -> Language
.
Supported Languages
Document Reader SDK supports the following languages:
- Arabic (ar)
- Bangla (bn)
- Czech (cs)
- Danish (da)
- German (de)
- Greek (el)
- English (en)
- Spanish (es)
- Finnish (fi)
- French (fr)
- Hebrew (he)
- Hindi (hi)
- Croatian (hr)
- Hungarian (hu)
- Indonesian (id)
- Italian (it)
- Japanese (ja)
- Korean (ko)
- Malay (ms)
- Norwegian (nb)
- Dutch (nl)
- Polish (pl)
- Portuguese (pt)
- Romanian (ro)
- Russian (ru)
- Slovak (sk)
- Swedish (sv)
- Thai (th)
- Turkish (tr)
- Ukrainian (uk)
- Vietnamese (vi)
- Chinese Simplified (zh-Hans)
- Chinese Traditional (zh-Hant)