Error with translation

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
User avatar
Mirrodin
Regular
Posts: 84
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Error with translation

#1 Post by Mirrodin » Mon May 21, 2018 12:00 pm

Hi guys,

I hope you can help me on this one, because this make me salty for the entire day.
I want to change my obsolete translation system for the standart one

So I generate my translation file "english" my original lang is french.
ok generate success.

Now I do that to my imagebutton in menu:

Code: Select all

        imagebutton idle "gui/bouton_menu/fr.png" hover "gui/bouton_menu/fr_hover.png" selected_idle "gui/bouton_menu/fr_selected.png"  action SetVariable("lang", "francais"), Language(None) xpos 270 ypos 650
        imagebutton idle "gui/bouton_menu/eng.png" hover "gui/bouton_menu/eng_hover.png" selected_idle "gui/bouton_menu/eng_selected.png"  action SetVariable("lang","english"), Language("english") xpos 200 ypos 650
(lang is my old conditionnal variable)

and this in option:

Code: Select all

init -3 python:
    if persistent.lang is None:
        persistent.lang = "english"

    lang = persistent.lang
So... When I launch my game, the game must start in english, but my dialogue are still in french, and when I choose french in the main menu I have this error...
I have to admit, I'm lost, I guess it was pretty simple, and I lost a day on that damn error..

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00start.rpy", line 270, in script
    python:
  File "renpy/common/00start.rpy", line 274, in <module>
    renpy.call_in_new_context("_main_menu")
  File "renpy/common/00action_other.rpy", line 350, in __call__
    renpy.change_language(self.language)
  File "game/screens.rpy", line 300, in prepare_screen
    screen quick_menu():
  File "game/screens.rpy", line 300, in prepare
    screen quick_menu():
  File "game/screens.rpy", line 305, in prepare
    if quick_menu:
  File "game/screens.rpy", line 305, in prepare
    if quick_menu:
  File "game/screens.rpy", line 307, in prepare
    hbox:
  File "game/screens.rpy", line 307, in prepare
    hbox:
  File "game/screens.rpy", line 315, in prepare
    textbutton _("Q.Save") action QuickSave()
  File "game/screens.rpy", line 315, in prepare
    textbutton _("Q.Save") action QuickSave()
  File "renpy/common/00action_file.rpy", line 872, in QuickSave
    FileSave(1, page="quick", confirm=False, cycle=True, newest=newest),
  File "renpy/common/00action_file.rpy", line 344, in __init__
    self.alt = __("Save slot %s: [text]") % (name,)
TypeError: not all arguments converted during string formatting

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "D:\renpy-6.99.12.4-sdk\renpy\bootstrap.py", line 306, in bootstrap
    renpy.main.main()
  File "D:\renpy-6.99.12.4-sdk\renpy\main.py", line 513, in main
    run(restart)
  File "D:\renpy-6.99.12.4-sdk\renpy\main.py", line 139, in run
    renpy.execution.run_context(True)
  File "D:\renpy-6.99.12.4-sdk\renpy\execution.py", line 846, in run_context
    context.run()
  File "renpy/common/00start.rpy", line 270, in script
    python:
  File "D:\renpy-6.99.12.4-sdk\renpy\ast.py", line 862, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "D:\renpy-6.99.12.4-sdk\renpy\python.py", line 1888, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/00start.rpy", line 274, in <module>
    renpy.call_in_new_context("_main_menu")
  File "D:\renpy-6.99.12.4-sdk\renpy\game.py", line 337, in call_in_new_context
    return renpy.execution.run_context(False)
  File "D:\renpy-6.99.12.4-sdk\renpy\execution.py", line 846, in run_context
    context.run()
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "D:\renpy-6.99.12.4-sdk\renpy\ast.py", line 862, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "D:\renpy-6.99.12.4-sdk\renpy\python.py", line 1888, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "D:\renpy-6.99.12.4-sdk\renpy\ui.py", line 287, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2635, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\core.py", line 3437, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 992, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 992, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 992, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 689, in event
    rv = self.child.event(ev, x, y, st)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 992, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\behavior.py", line 906, in event
    return handle_click(self.clicked)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\behavior.py", line 841, in handle_click
    rv = run(action)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\behavior.py", line 308, in run
    new_rv = run(i, *args, **kwargs)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\behavior.py", line 315, in run
    return action(*args, **kwargs)
  File "renpy/common/00action_other.rpy", line 350, in __call__
    renpy.change_language(self.language)
  File "D:\renpy-6.99.12.4-sdk\renpy\translation\__init__.py", line 607, in change_language
    renpy.style.rebuild()  # @UndefinedVariable
  File "style.pyx", line 793, in renpy.style.rebuild
  File "D:\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 895, in prepare_screens
    s.ast.prepare_screen()
  File "game/screens.rpy", line 300, in prepare_screen
    screen quick_menu():
  File "game/screens.rpy", line 300, in prepare
    screen quick_menu():
  File "game/screens.rpy", line 305, in prepare
    if quick_menu:
  File "game/screens.rpy", line 305, in prepare
    if quick_menu:
  File "game/screens.rpy", line 307, in prepare
    hbox:
  File "game/screens.rpy", line 307, in prepare
    hbox:
  File "game/screens.rpy", line 315, in prepare
    textbutton _("Q.Save") action QuickSave()
  File "game/screens.rpy", line 315, in prepare
    textbutton _("Q.Save") action QuickSave()
  File "D:\renpy-6.99.12.4-sdk\renpy\python.py", line 1912, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "<screen language>", line 315, in <module>
  File "renpy/common/00action_file.rpy", line 872, in QuickSave
    FileSave(1, page="quick", confirm=False, cycle=True, newest=newest),
  File "renpy/common/00action_file.rpy", line 344, in __init__
    self.alt = __("Save slot %s: [text]") % (name,)
TypeError: not all arguments converted during string formatting

Windows-8-6.2.9200
Ren'Py 6.99.14.3.3347
The Pleasuremancer 0.3.1a - Patreon only - Dev version 
Mon May 21 17:52:21 2018

User avatar
Mirrodin
Regular
Posts: 84
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Re: Error with translation

#2 Post by Mirrodin » Mon May 21, 2018 12:45 pm

Tried on a test project, same error, what I miss ?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1718
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: Error with translation

#3 Post by Donmai » Mon May 21, 2018 1:39 pm

You should simply add a gui folder to your tl/english folder and put English versions of your imagebutton files there.
https://www.renpy.org/doc/html/translat ... anslations
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Mirrodin
Regular
Posts: 84
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Re: Error with translation

#4 Post by Mirrodin » Mon May 21, 2018 3:07 pm

Thanks, but not working.

I copy my entire gui folder in tl/english

still have the bug when I try to past in english translation in main menu

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00start.rpy", line 270, in script
    python:
  File "renpy/common/00start.rpy", line 274, in <module>
    renpy.call_in_new_context("_main_menu")
  File "renpy/common/00action_other.rpy", line 350, in __call__
    renpy.change_language(self.language)
  File "game/screens.rpy", line 300, in prepare_screen
    screen quick_menu():
  File "game/screens.rpy", line 300, in prepare
    screen quick_menu():
  File "game/screens.rpy", line 305, in prepare
    if quick_menu:
  File "game/screens.rpy", line 305, in prepare
    if quick_menu:
  File "game/screens.rpy", line 307, in prepare
    hbox:
  File "game/screens.rpy", line 307, in prepare
    hbox:
  File "game/screens.rpy", line 315, in prepare
    textbutton _("Q.Save") action QuickSave()
  File "game/screens.rpy", line 315, in prepare
    textbutton _("Q.Save") action QuickSave()
  File "renpy/common/00action_file.rpy", line 872, in QuickSave
    FileSave(1, page="quick", confirm=False, cycle=True, newest=newest),
  File "renpy/common/00action_file.rpy", line 344, in __init__
    self.alt = __("Save slot %s: [text]") % (name,)
TypeError: not all arguments converted during string formatting

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "D:\renpy-6.99.12.4-sdk\renpy\bootstrap.py", line 306, in bootstrap
    renpy.main.main()
  File "D:\renpy-6.99.12.4-sdk\renpy\main.py", line 513, in main
    run(restart)
  File "D:\renpy-6.99.12.4-sdk\renpy\main.py", line 139, in run
    renpy.execution.run_context(True)
  File "D:\renpy-6.99.12.4-sdk\renpy\execution.py", line 846, in run_context
    context.run()
  File "renpy/common/00start.rpy", line 270, in script
    python:
  File "D:\renpy-6.99.12.4-sdk\renpy\ast.py", line 862, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "D:\renpy-6.99.12.4-sdk\renpy\python.py", line 1888, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/00start.rpy", line 274, in <module>
    renpy.call_in_new_context("_main_menu")
  File "D:\renpy-6.99.12.4-sdk\renpy\game.py", line 337, in call_in_new_context
    return renpy.execution.run_context(False)
  File "D:\renpy-6.99.12.4-sdk\renpy\execution.py", line 846, in run_context
    context.run()
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "D:\renpy-6.99.12.4-sdk\renpy\ast.py", line 862, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "D:\renpy-6.99.12.4-sdk\renpy\python.py", line 1888, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "D:\renpy-6.99.12.4-sdk\renpy\ui.py", line 287, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2635, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\core.py", line 3437, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 992, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 992, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 992, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 689, in event
    rv = self.child.event(ev, x, y, st)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 992, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\behavior.py", line 906, in event
    return handle_click(self.clicked)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\behavior.py", line 841, in handle_click
    rv = run(action)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\behavior.py", line 308, in run
    new_rv = run(i, *args, **kwargs)
  File "D:\renpy-6.99.12.4-sdk\renpy\display\behavior.py", line 315, in run
    return action(*args, **kwargs)
  File "renpy/common/00action_other.rpy", line 350, in __call__
    renpy.change_language(self.language)
  File "D:\renpy-6.99.12.4-sdk\renpy\translation\__init__.py", line 607, in change_language
    renpy.style.rebuild()  # @UndefinedVariable
  File "style.pyx", line 793, in renpy.style.rebuild
  File "D:\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 895, in prepare_screens
    s.ast.prepare_screen()
  File "game/screens.rpy", line 300, in prepare_screen
    screen quick_menu():
  File "game/screens.rpy", line 300, in prepare
    screen quick_menu():
  File "game/screens.rpy", line 305, in prepare
    if quick_menu:
  File "game/screens.rpy", line 305, in prepare
    if quick_menu:
  File "game/screens.rpy", line 307, in prepare
    hbox:
  File "game/screens.rpy", line 307, in prepare
    hbox:
  File "game/screens.rpy", line 315, in prepare
    textbutton _("Q.Save") action QuickSave()
  File "game/screens.rpy", line 315, in prepare
    textbutton _("Q.Save") action QuickSave()
  File "D:\renpy-6.99.12.4-sdk\renpy\python.py", line 1912, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "<screen language>", line 315, in <module>
  File "renpy/common/00action_file.rpy", line 872, in QuickSave
    FileSave(1, page="quick", confirm=False, cycle=True, newest=newest),
  File "renpy/common/00action_file.rpy", line 344, in __init__
    self.alt = __("Save slot %s: [text]") % (name,)
TypeError: not all arguments converted during string formatting

Windows-8-6.2.9200
Ren'Py 6.99.14.3.3347
The Pleasuremancer 0.3.1a - Patreon only - Dev version 
Mon May 21 21:04:47 2018

User avatar
Mirrodin
Regular
Posts: 84
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Re: Error with translation

#5 Post by Mirrodin » Mon May 21, 2018 3:16 pm

This is unbelivelable, I try the tutoriel world by world with a new project and still not work OMG.
What a day... I have no idea what I miss..
Trying this tuto and didn't work
viewtopic.php?t=43333
Is there a new method for translation with the new update of renpy ?

User avatar
xavimat
Eileen-Class Veteran
Posts: 1225
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: xavimat
Location: Italy
Contact:

Re: Error with translation

#6 Post by xavimat » Mon May 21, 2018 5:12 pm

I suspect it's a bug in renpy. I've made/updated the Spanish translation of Renpy and that single line was giving problems, so it's the only one not translated in Spanish.

Try this: search in tl/english/common.rpy that line ("Save slot %s: [text]") and delete the old and new lines.
If that doesn't work, do the same in tl/None/common.rpym.

If any of this works, please tell us here and we'll fill a bug report.
Last edited by xavimat on Wed May 23, 2018 2:16 pm, edited 1 time in total.
Cops&Robbers A two-player experiment
Fear&Love Why can’t we simply express our feelings? Why am I afraid to say ‘I love you’?
unknown [Sci-Fi - mystery - computer]
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Mirrodin
Regular
Posts: 84
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Re: Error with translation

#7 Post by Mirrodin » Tue May 22, 2018 2:41 am

It's that.
I delete the whole save/load stuff, you're right, why I don't think about that grrr, I was so mad about me yesterday I never thought it was a bug.
Thanks a lot, A day of rage corrected in a few minuts

kivik
Miko-Class Veteran
Posts: 731
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Error with translation

#8 Post by kivik » Tue May 22, 2018 3:59 am

Mirrodin wrote:
Tue May 22, 2018 2:41 am
A day of rage corrected in a few minuts
You're one of us now :P

User avatar
xavimat
Eileen-Class Veteran
Posts: 1225
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: xavimat
Location: Italy
Contact:

Re: Error with translation

#9 Post by xavimat » Tue May 22, 2018 4:04 pm

kivik wrote:
Tue May 22, 2018 3:59 am
Mirrodin wrote:
Tue May 22, 2018 2:41 am
A day of rage corrected in a few minuts
You're one of us now :P
:lol: :lol:
Reported: https://github.com/renpy/renpy/issues/1465
Cops&Robbers A two-player experiment
Fear&Love Why can’t we simply express our feelings? Why am I afraid to say ‘I love you’?
unknown [Sci-Fi - mystery - computer]
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Mirrodin
Regular
Posts: 84
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Re: Error with translation

#10 Post by Mirrodin » Wed May 23, 2018 3:28 am

:) Hope my 'sacrifice' will help Renp'y to improve

Post Reply

Who is online

Users browsing this forum: Google [Bot]