Language
Language (lang) is the parameter that tells the InAppStory SDK which language to render the reader's UI texts.
What to do with Language
During the initialization of the InAppStory SDK the language must be specified in the initialization code, in the lang parameter (name and place may vary across platforms).
Android example
fun createInAppStoryManager(
apiKey: String,
context: Context,
userId: String,
lang: Locale
): InAppStoryManager {
return InAppStoryManager.Builder()
.apiKey(apiKey)
.context(context)
.userId(userId)
.lang(lang) // <-- put language here
.create()
}
iOS example
import UIKit
import InAppStorySDK
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
InAppStory.shared.initWith(
serviceKey: <api-key>,
settings: Settings(
userID: <userID>,
lang: <language code>)) //put language here
return true
}
}
WEB example
const inAppStoryManagerConfig = {
apiKey: "{project-integration-key}",
userId: "{user-identifier}",
lang: "en-US", // put language here
};
Flutter example
Flutter uses locale instead of lang:
Future<void> initSDK() async {
await InAppStoryPlugin().initWith(
'<your api key>',
'<user id>',
locale: <locale>, // put language here
);
}
warning
If the previously installed lang (or locale for Flutter) is not equal to what it was before, a new session will be opened, which will update feeds and close all readers - the same behaviour as changing userID.
For more information about setting the language you can refer to these guides:
- JS SDK:
langfield inInAppStoryManagerConfig. See Configuration. - React SDK:
langfield inStoryManagerConfig. See Configuration. - React Native SDK:
langfield inStoryManagerConfig. See Stories List. - iOS:
langparameter of theSettingsobject. See User settings · How to get started. - Android:
langonInAppStoryManager.Builder()(orInAppStoryUserSettings().lang(...)foruserSettings). See InAppStoryManager · User settings. - Flutter: uses
localeinstead oflang. See How to get started · User Settings.