Localization on .NET MAUI
Customizing Localization
Document Reader SDK supports localization using standard iOS System Settings. If a language is required by your application but is not supported by the SDK, or you want to change our localized strings, you can add localized strings to the additional resource files and allow the SDK to be presented to users in their required system locale.
iOS
To get started, add the CFBundleLocalizations
property to the Info.plist
file and specify the languages. If you just want to enable localization and don't want to edit prelocalized strings, then this is the only step needed and everything else can be skipped.
Next, include the string resource file named RegulaSDK.strings
, which is provided with the latest SDK release version, to your language-specific folder under Platforms\iOS\Resources
. For example if you want to change strings for french and english languages, you need to edit files Platforms\iOS\Resources\en.lproj\RegulaSDK.strings
and Platforms\iOS\Resources\fr.lproj\RegulaSDK.strings
.
!!!
Don't forget to include iOS resources folder into the bundle in your .csproj file: <BundleResource Include="Platforms\iOS\Resources\**" />
Now you can replace every string in the SDK with appropriate translated values. Thus, when a user sets the device's System Language to a language supported by your application, the SDK utilizes the appropriate string resources.
You can find the RegulaSDK.strings
file with all the available strings here: Project-name/Pods/DocumentReader/DocumentReader.xcframework/ios-arm64/DocumentReader.framework/en.lproj/RegulaSDK.strings
.
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.
For more information on localizing your application and best practices, please refer to the official Microsoft documentation.
Android
To do this, simply add the needed strings to strings.xml
file.
For more information on localizing your application and best practices, please see the official Microsoft documentation.