Change language

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
Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Change language

#1 Post by Mirenzo »

Hi all, i have read the post [Tutorial] Creating Translations for Ren'Py Games, by Morhighan, it's not clear (for me) where exactly i have to put this line:
hotspot(#,#,#,#) action ShowMenu("language_chooser") #insert coordinates appropriately.
I'm not using any imagemap so i suppose i have to put this line in screen.rpy but where?
Where can i find this "Option Menu"?
Thank you in advance.

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Change language

#2 Post by rayminator »

in screen.rpy it should be on line 312 that for main menu

for preference also known as options should be on line 717

Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Re: Change language

#3 Post by Mirenzo »

I put here the line but nothing change to me.
################################################################################
## Main Menu e Game Menu
################################################################################

## Navigation screen ###########################################################
##
## Questo screen è incluso nel main menu e nel game menu, e consente di navigare
## verso altri menu o di iniziare il gioco.

hotspot(98,72,382,277) action ShowMenu "English" #insert coordinates appropriately

screen navigation():

vbox:
style_prefix "navigation"

xpos gui.navigation_xpos
yalign 0.5

spacing gui.navigation_spacing

if main_menu:

textbutton _("Inizia") action Start()
I really need this change language working. I write my game in Italian language. Need to transalate it in English.

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Change language

#4 Post by rayminator »

we need to see the whole code to help you better

when you do post a script try using the

Code: Select all

[code]add /[code]

Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Re: Change language

#5 Post by Mirenzo »

I was looking to use that but since i'm newbee, didn't find how to use it.
For whole code you means the whole screens file or just the Main Menu e Game Menu?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
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, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Change language

#6 Post by Donmai »

If you aren't using image maps then you don't need that line. If you created your game in Italian, then Italian is the None language. Generate your English translation and translate the strings in game/tl/english. See the screens.rpy of the Ren'Py tutorial game for an example of how to add a language switching option. You just add this to the preferences section of screens.rpy:

Code: Select all

                vbox:
                    style_prefix "radio"
                    label _("Cambiare la lingua")

                    textbutton "Italiano" action Language(None)
                    textbutton "English" action Language("english")
Actually you should do this before generating translations so the "Cambiare la lingua" Italian string could be added to the translatable screens in the TL folder. But you can always generate English translations one more time and the strings list will be updated.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Re: Change language

#7 Post by Mirenzo »

Thank you for your answer Donmai. I was starting my game using an Italian interface and Italian language. Afther someone tell me there was problem changin interface so i change and now i'm using English interface writing only the text in italian. Is it possible to translate only the text? I suppose my None language is English.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
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, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Change language

#8 Post by Donmai »

Whoever told you that was confused. You can create your game entirely in Italian if you want, then add a translation to any other language. Inside the TL folder, you will find a commons.rpy file that contains (or should contain) all the interface text ready to be translated. If your dialogues are in Italian, then Italian is the None language, no matter your interface text is in another language. I suggest you revert your interface text to Italian, then generate the English translations. Please note that to be included in the translation, any interface strings you add must be enclosed in _() as in the example I showed you before:

Code: Select all

_("cambiare la lingua")
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Re: Change language

#9 Post by Mirenzo »

Hi Donmai, thanks to your instruction i'm now capable to see in options screen the changing language options Italian and English but, when i choose English my Italian U.I. disappear but the English one don't show up.
To be clear with you i followed the instruction by Morhighan in [Tutorial] Creating Translations for Ren'Py Game i only didn't put the last line in screens.rpy as you suggest but put your line.
I have created the game/tl/english folders but didn't translate any words in it, i'm waiting to find a good italian/english translater.

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

Re: Change language

#10 Post by xavimat »

Mirenzo wrote: Thu Mar 01, 2018 8:39 amwhen i choose English my Italian U.I. disappear but the English one don't show up.
If you have generated the English translation, then you have the files with empty strings. If Renpy finds the empty strings, it uses them, so you see nothing. It some strings are not translated, Renpy will use the original Italian ones.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
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, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Change language

#11 Post by Donmai »

Mirenzo wrote: Thu Mar 01, 2018 8:39 am when I choose English my Italian U.I. disappear but the English one doesn't show up
That's fine. You won't see any English text because, as you said, you still don't have the translated text. That should be done manually. For the interface, you can try copying the English strings from tutorial/game/tl/piglatin/screens.rpy to your tl/english/screens.rpy. That's lots of work, I know, but translating games really means lots of work, or I'm misunderstanding everything. For example, there's a 'Merge Translations' option in the Launcher, but I'm yet to find out what is it for.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Re: Change language

#12 Post by Mirenzo »

Thanks Donmai, do you really think when i'll find someone that will translate my text in tl/english, the english U.I. will appear? I hope so but... we will see.
I'm really surprised to know that a program as RenPy that have everyting included and get about monthly updates, it's so difficult to do a simple thing like change language.
In a time where the world it's becaming every day more short, do a thing like this should be more easy.

Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Re: Change language

#13 Post by Mirenzo »

Solved

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]