How to detect system(PC,phone) language &auto setting renpy

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
decemer
Regular
Posts: 34
Joined: Tue Jun 11, 2013 11:28 am
Contact:

How to detect system(PC,phone) language &auto setting renpy

#1 Post by decemer » Sun May 08, 2016 11:50 pm

How to detect system(PC,phone) language &auto setting renpy language?
:D THX
which variable is setting?

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: How to detect system(PC,phone) language &auto setting re

#2 Post by xela » Mon May 09, 2016 12:29 am

Like what we're doing? Support us at:
Image

decemer
Regular
Posts: 34
Joined: Tue Jun 11, 2013 11:28 am
Contact:

Re: How to detect system(PC,phone) language &auto setting re

#3 Post by decemer » Mon May 09, 2016 2:40 am

it should take system language

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: How to detect system(PC,phone) language &auto setting re

#4 Post by xela » Mon May 09, 2016 2:51 am

decemer wrote:
it should take system language
Maybe:

http://stackoverflow.com/questions/3425 ... -in-python

???
Like what we're doing? Support us at:
Image

decemer
Regular
Posts: 34
Joined: Tue Jun 11, 2013 11:28 am
Contact:

Re: How to detect system(PC,phone) language &auto setting re

#5 Post by decemer » Sat May 14, 2016 2:23 am

xela wrote:
decemer wrote:
it should take system language
Maybe:

http://stackoverflow.com/questions/3425 ... -in-python

???

Code: Select all

#python3 cmd code:
import locale
myloacl=locale.getdefaultlocale()[0][:2]
print("myloacl:   "+myloacl)
if myloacl=='en':
    language = "english"
elif myloacl=='zh': 
    language = "None"
else:
    language = "None"
print("language:   "+language)

Code: Select all

init python:
    import locale
    myloacl=(locale.getdefaultlocale())[0][:2]
    if myloacl=='en':
        config.language = "english"
    elif myloacl=='zh': 
        config.language = None
    else:
        config.language = None
I Done it!! :D :lol: :lol: :lol:

decemer
Regular
Posts: 34
Joined: Tue Jun 11, 2013 11:28 am
Contact:

Re: How to detect system(PC,phone) language &auto setting re

#6 Post by decemer » Thu May 19, 2016 11:08 pm

on my virtual os x, it cant work,anybody work this in os x?mac iphone,cant use this

Post Reply

Who is online

Users browsing this forum: Google [Bot]