Bug fixes and improvements

* Fixed renpy.input not working with Chinese translation
* Improved language handling for preferences
This commit is contained in:
LoafyLemon 2022-11-05 21:27:34 +00:00
parent 8af7186c97
commit 1b1bc53759
3 changed files with 13 additions and 3 deletions

View File

@ -2,3 +2,7 @@
define CHARACTERS = {"hermione", "tonks", "astoria", "cho", "luna", "susan", "hooch"} define CHARACTERS = {"hermione", "tonks", "astoria", "cho", "luna", "susan", "hooch"}
define SAYERS = {i[:3]:i for i in CHARACTERS} define SAYERS = {i[:3]:i for i in CHARACTERS}
define ALLOWED_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " define ALLOWED_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "
define LANGUAGE_TRANSCRIPTS = {
"english": "{font=gui/CreativeBlockRegular.ttf}English{/font}",
"chinese": "{font=tl/chinese/NotoSansSC-Bold.otf}汉语{/font}",
}

View File

@ -120,9 +120,13 @@ screen preferences_general():
hbox: hbox:
spacing 2 spacing 2
textbutton "English" action Language(None) textbutton LANGUAGE_TRANSCRIPTS.get("english") action Language(None)
for i in languages:
textbutton i.capitalize() action Language(i) # Each language should be displayed in its native tongue.
# Please do not translate other language names.
for lang in languages:
$ transcript = LANGUAGE_TRANSCRIPTS.get(lang, lang)
textbutton transcript action Language(lang)
screen preferences_visuals(): screen preferences_visuals():
hbox: hbox:

View File

@ -4,3 +4,5 @@ translate chinese style default:
translate chinese python: translate chinese python:
gui.text_font = "tl/chinese/NotoSansSC-Bold.otf" gui.text_font = "tl/chinese/NotoSansSC-Bold.otf"
gui.bold_font = "tl/chinese/NotoSansSC-Black.otf" gui.bold_font = "tl/chinese/NotoSansSC-Black.otf"
# Note: This is required for non-alphabetic scripts to support inputs.
ALLOWED_CHARACTERS = None