automatic language detection .apk

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Kenno
Newbie
Posts: 2
Joined: Sun Sep 17, 2017 3:46 am
Contact:

automatic language detection .apk

#1 Post by Kenno »

Good afternoon
Using the Ren'Py engine I create a Visual novel for the Android OS, I have a handwritten menu in the screens file and now there is no language switch. So the question was whether it is possible to complete the game code so that the .apk file itself determines the language of the Android OS installed on the phone and switches the language of the game to it.
If there is such a code, please send it to me, with detailed instructions on how to place it.

Kenno
Newbie
Posts: 2
Joined: Sun Sep 17, 2017 3:46 am
Contact:

Re: automatic language detection .apk

#2 Post by Kenno »

if renpy.android:
from jnius import autoclass
Locale = autoclass('java.util.Locale')
current_language = str(Locale.getDefault().getLanguage())

viewtopic.php?f=8&t=33146

Post Reply

Who is online

Users browsing this forum: No registered users