Customize the language that returns in my.getSystemInfo JSAPI
Customize the language that returns in my.getSystemInfo JSAPI
To return app language but not the system language in my.getSystemInfo JSAPI, implement the GRVAppLanguageDelegate.
Note that the format of return value in getAppLanguage is "language-country(region)", where language must follow the ISO 639-1 specification, and country(region) must follow the ISO 3166-1 specification, such as "zh-CN", "en-US".
@protocol GRVAppLanguageDelegate <NSObject>
/// The returned value must use the format 'language-country(region)'. 'language' part should conform to ISO 639-1, and country(region) should conform to ISO 3166-1. For example: 'zh-HK', 'en-US'
- (NSString * _Nonnull)getAppLanguage;
@endSample Code
// when IAPConnect is initialized
let extensionDelegate = GRVExtensionDelegate()
extensionDelegate.appLanguageDelegate = DemoAppLanguageDelegate()
class DemoAppLanguageDelegate: NSObject, GRVAppLanguageDelegate {
func getAppLanguage() -> String {
return "en-US"
}
}