Search code examples
android-studiopepper

Set/change default app language in Anroid Studio


Quick question... I am programming a Pepper chatbot using QiChat on Android Studio. The default language of the chat should be German. When creating topics tho, it reads "will be created in the default language of the app", with no option to change it there. Apparently the default language is English - how can I change it?

TIA!


Solution

  • The Chat API of Pepper allows you to set your preferred language.

    In this tutorial, they show that you can set the locale of the Chat when building it, this way:

    val chat: Chat = ChatBuilder.with(qiContext)
            .withChatbot(qiChatbot)
            .withLocale(locale)
            .build()
    

    Note however that in general, on Android, the current locale is decided by the user, via the settings. In order to respect the user's decision, it is preferable that you use this mechanism only as a fallback.