Translations: translate_font() is not defined? [MISTAKE]

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
017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Translations: translate_font() is not defined? [MISTAKE]

#1 Post by 017Bluefield »

While fiddling with my project, I tried changing the style.rpy of my Japanese translation for this:

Code: Select all

init python:
    translate_font("japanese", "fonts/SmartFontUI.otf")
    translate_define("japanese", "gui.language", "'japanese-normal'")

translate japanese python:
    gui.FONT_SCALE = .9
However, when I launch the game, I get this:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/tl/japanese/style.rpy", line 1, in script
    init python:
  File "game/tl/japanese/style.rpy", line 2, in <module>
    translate_font("japanese", "fonts/SmartFontUI.otf")
NameError: name 'translate_font' is not defined
I'm not sure why it's treating translate_font() like this. Am I doing something wrong?
Last edited by 017Bluefield on Thu Aug 09, 2018 12:51 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Translations: translate_font() is not defined?

#2 Post by PyTom »

That function is used in the launcher, only. For a normal game, use a translate python block to set the appropriate gui variables, or a translate style block to change the style.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: Translations: translate_font() is not defined? [MISTAKE]

#3 Post by 017Bluefield »


Post Reply

Who is online

Users browsing this forum: No registered users