Multilingual game
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.
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.
Multilingual game
Aloha, people!
I seeking best way to make and support more than two languages in visual novel. There I found some interesting solutions, but no one of them didn't solve major problem: it's better for translators to separate literary text and script commands. Especially good thing is to make text files for each language. But how?
I seeking best way to make and support more than two languages in visual novel. There I found some interesting solutions, but no one of them didn't solve major problem: it's better for translators to separate literary text and script commands. Especially good thing is to make text files for each language. But how?
-
- Eileen-Class Veteran
- Posts: 1686
- Joined: Mon Sep 21, 2009 8:03 pm
- Projects: E-mail me if you wanna rock the planet
- Location: USA
- Contact:
Re: Multilingual game
Make a new text file and name it English.rpy and French.rpy for each one, perhaps?
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com
https://cherylitou.wordpress.com
Re: Multilingual game
Привет! (hi)
Mmm, you can try this http://lemmasoft.renai.us/forums/viewto ... f=8&t=5814
Downloadable sample has comments in the code, so the part of it might be useful for you.
P.S. take it as my self-advertising...))
Mmm, you can try this http://lemmasoft.renai.us/forums/viewto ... f=8&t=5814
Downloadable sample has comments in the code, so the part of it might be useful for you.
P.S. take it as my self-advertising...))
-
- Eileen-Class Veteran
- Posts: 1686
- Joined: Mon Sep 21, 2009 8:03 pm
- Projects: E-mail me if you wanna rock the planet
- Location: USA
- Contact:
Re: Multilingual game
I bet that's just what Leaden wanted.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com
https://cherylitou.wordpress.com
Re: Multilingual game
It's simple and reliable method, but only when your game finalized on one language and then translating into others. In other cases every change in script will multiply on amount of supported languages.JinzouTamashii wrote:Make a new text file and name it English.rpy and French.rpy for each one, perhaps?
Re: Multilingual game
Здравствуй, товарищ!Alex wrote:Привет! (hi)
Mmm, you can try this http://lemmasoft.renai.us/forums/viewto ... f=8&t=5814
Downloadable sample has comments in the code, so the part of it might be useful for you.
P.S. take it as my self-advertising...))
Thanks for example. There some intresting ideas, but in general this solution not suitable. Binding to string numbers not flexible and don't allow to insert comments for tranlators and readability. And this example works on very simple game: linear, without pictures, characters, menus. Sorry, but I want more )
Re: Multilingual game
May be one of 189 games on RenPy have that feature that I talked about?
Re: Multilingual game
?!And this example works on very simple game: linear, without pictures, characters, menus.
everything can be included as usual... if you still interested in more comments about it you can mail me Lex__2007@mail.ru
Re: Multilingual game
Theoreticaly yes, but try this on practise Update you example with dialog tree and you will see what I'm worry for.Alex wrote:?!And this example works on very simple game: linear, without pictures, characters, menus.
everything can be included as usual... if you still interested in more comments about it you can mail me Lex__2007@mail.ru
And I like to stay in public discussion, because it may be useful for someone else.
Re: Multilingual game
Well, for example - slightly modified "The question" (sorry, this one once again)Theoreticaly yes, but try this on practise
http://rapidshare.com/files/299279550/t ... transl.zip
http://rapidshare.com/files/299280222/t ... 86.tar.bz2
http://rapidshare.com/files/299280773/t ... sl-mac.zip
In preferences you can change game language.
I believe you can easily add another translation (make "lang2.txt" and "Translated__3.rpy" and place them in game folder)
Here it is a part of code:
Code: Select all
... ... ...
# The game starts here.
label start:
scene black
call after_load from _after_load_2
$ bl_game = False
play music "illurock.ogg"
scene bg lecturehall
with fade
$ q (None, 5)
$ q (None, 6)
$ q (None, 7)
$ q (None, 8)
$ q (None, 9)
scene bg uni
with fade
$ q (None, 10)
show sylvie normal
with dissolve
$ q (None, 11)
$ q (None, 12)
$ q (None, 13)
$ q (None, 14)
$ q (None, 15)
$ q (None, 16)
$ q (None, 17)
$ q (None, 18)
$ q (None, 19)
$ menu_0 = ph[lang][20]
$ menu_1 = ph[lang][21]
menu:
"%(menu_0)s":
jump rightaway
"%(menu_1)s":
jump later
... ... ...
-
- Newbie
- Posts: 7
- Joined: Wed Apr 18, 2007 2:04 am
- Projects: Season of Sakura Brasil
- Location: Brazil
- Contact:
Re: Multilingual game
Well, well... I have the same problem, Leaden.
After all my hard work developing the script in Portuguese, how make the game become multilingual? I don't know if my solution is a good way... but it is a soft solution.
1st step:
Insert into file \renpy\config.py the following variable:
2nd step:
Edit the file \renpy\display\text.py, the code of all the text showed in the screen:
about the line 897:
about the line 1025:
3rd Step:
Now, you must add the tag {t}translated text{/t} into your script, everywhere you want change the idiom.
Example, The Question:
We can create any type of handler to change the idiom, just change the value of the config variable current_idiom change the idiom of the text.
I know, edit the code of text.py isn't good, because you may have instable behavior, and a future release doesn't complain your changes.
Thanks for attention!
Papaxibé
After all my hard work developing the script in Portuguese, how make the game become multilingual? I don't know if my solution is a good way... but it is a soft solution.
1st step:
Insert into file \renpy\config.py the following variable:
Code: Select all
current_idiom = 0
Edit the file \renpy\display\text.py, the code of all the text showed in the screen:
about the line 897:
Code: Select all
tokens = [ ]
for l in self.tokens:
tokens.extend(l)
ti = iter(tokens)
##---------------------------------------------------------------------------
##begin of multilingual code
##---------------------------------------------------------------------------
if ("tag", "t") in tokens:
if renpy.config.current_idiom == 0:
tsl[-1].size = self.style.size
else:
tsl[-1].size = 0
tsl[-1].update()
##---------------------------------------------------------------------------
##end of multilingual code
##---------------------------------------------------------------------------
for kind, i in ti:
# Newline.
if kind == "newline":
triples.append(("newline", tsl[-1], ""))
continue
Code: Select all
tsl[-1].strikethrough = style.strikethrough
tsl[-1].color = style.color
tsl[-1].black_color = style.black_color
tsl[-1].update()
##---------------------------------------------------------------------------
##begin of multilingual code
##---------------------------------------------------------------------------
elif i == "t":
if renpy.config.current_idiom == 0:
tsl[-1].size = 0
else:
tsl[-1].size = self.style.size
tsl[-1].update()
##---------------------------------------------------------------------------
##end of multilingual code
##---------------------------------------------------------------------------
elif i.startswith("font"):
m = re.match(r'font=(.*)', i)
Now, you must add the tag {t}translated text{/t} into your script, everywhere you want change the idiom.
Example, The Question:
Code: Select all
# The game starts here.
label start:
$ config.current_idiom = 1 ## this line change the idiom to Portuguese
$ bl_game = False
play music "illurock.ogg"
scene bg lecturehall
with fade
"Well, professor Eileen's lecture was interesting.{t}Bem, a palestra da professora Eileen foi interessante.{/t}"
"But to be honest, I couldn't concentrate on it very much.{t}Mas para ser bem honesto, Eu não consegui me concentrar muito bem.{/t}"
"I had a lot of other thoughts on my mind.{t}Estava pensando em muitas outras coisas.{/t}"
"And they all ended up with a question.{t}E todas acabavam numa pergunta.{/t}"
"A question, I've been meaning to ask someone.{t}Uma pergunta, que eu terei de fazer à alguém.{/t}"
scene bg uni
with fade
I know, edit the code of text.py isn't good, because you may have instable behavior, and a future release doesn't complain your changes.
Thanks for attention!
Papaxibé
- Attachments
-
- script.rpy
- (5.62 KiB) Downloaded 43 times
-
- text.py
- (44.42 KiB) Downloaded 36 times
Enquanto as andorinhas pastarem a relva selvagem, e os elefantes salpicarem de galho em galho, um velho sentado na pedra de pau, calado assim dizia: os três sábios da antiguidade eram quatro, Danúbio e Jacó.
Who is online
Users browsing this forum: Google [Bot], Ocelot