[solved] Random content tagged with _("content") still not showing up for 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
ComputerArt.Club
Veteran
Posts: 409
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

[solved] Random content tagged with _("content") still not showing up for translation

#1 Post by ComputerArt.Club » Fri Jul 19, 2019 2:34 am

So I am redoing one of my first games (an educational story game for beginner readers) and adding features and Chinese and Japanese translations (I'd also like to add German later). This section is a quiz to check if they can find the words from the story that they hear (basically checking they can actually recognize the words) but while adding one new feature random content, seemingly identical to other content, is not showing up in the translation scripts.

Image
(formatting is still a work in progress)

Out of about 20 similar screens, I think this is the only one where I am currently getting this error.

For example:

Code: Select all

L49    $ quiz_voice = _("01.ogg")
L50    # commented text here
L51    $ my_list = [{"txt":_("Cat"), "pos":(1030), "to_find":True},
L52    {"txt":_("bath"), "pos":(830), "to_find":False},
L53    {"txt":_("yellow"), "pos":(630), "to_find":False},
L54    ]
Only Cat is showing up for translation and not bath and yellow. There are many sections with identical code where all words get translated, but perhaps something happened to confuse Renpy, maybe lines got moved or something.
The translated file looks like this:

Code: Select all

    # quiz2.rpy:47
    old "01.ogg"
    new "t01.ogg"

    # quiz2.rpy:49
    old "Cat"
    new "貓咪"

    # quiz2.rpy:58
    ...
From what I can see, Cat is on line 51 now, but in the translated file it says 49, lines 52 and 53 have not been translated and won't update (perhaps I need to click a different option in the Generate Translations menu).

Also, the more I check this line, it also seems to give me out of memory errors, especially if I try to screenshot it.

This is an unaffected section of code that translates properly (minus the issues with voice detailed below):

Code: Select all

    $ my_list = [{"txt":_("white"), "pos":(1030), "to_find":False},
    {"txt":_("slow"), "pos":(830), "to_find":False},
    {"txt":_("brown"), "pos":(630), "to_find":True},
    ]
I can't see much of a difference, but I assume it might have been related to line number changes or something.

This method for translating the voice is also not working, although I was able to translate text used as a variable, for some reason it is not working for voice files. They come up in the translation document, but it just plays the English audio. :/

Any ideas, suggestions or feedback would be warmly welcomed. Thank you for taking the time to read this. :)
Last edited by ComputerArt.Club on Tue Jul 23, 2019 12:00 pm, edited 3 times in total.

User avatar
Andredron
Veteran
Posts: 345
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Random content tagged with _("content") still not showing up for translation

#2 Post by Andredron » Fri Jul 19, 2019 2:53 am

ComputerArt.Club wrote:
Fri Jul 19, 2019 2:34 am
So I am redoing one of my first games (an educational story game for beginner readers) and adding features and Chinese and Japanese translations. This section is a quiz to check if they can find the words from the story that they hear (basically checking they can actually recognize the words) but while adding one new feature random content, seemingly identical to other content, is not showing up in the translation scripts.

(formatting is still a work in progress)

Out of about 20 similar screens, I think this is the only one where I am currently getting this error.

For example:

Code: Select all

L49    $ quiz_voice = _("01.ogg")
L50    # commented text here
L51    $ my_list = [{"txt":_("Cat"), "pos":(1030), "to_find":True},
L52    {"txt":_("bath"), "pos":(830), "to_find":False},
L53    {"txt":_("yellow"), "pos":(630), "to_find":False},
L54    ]
Only Cat is showing up for translation and not bath and yellow. There are many sections with identical code where all words get translated, but perhaps something happened to confuse Renpy, maybe lines got moved or something.
The translated file looks like this:

Code: Select all

    # quiz2.rpy:47
    old "01.ogg"
    new "t01.ogg"

    # quiz2.rpy:49
    old "Cat"
    new "貓咪"

    # quiz2.rpy:58
    ...

Perhaps changed the script. But not the point.

By mistake with the text display. The code is written correctly, just for some reason it will not be displayed.

Go to Renpy launcher, and choose your project that needs translation.

Click in the navigation button - Create translation.

Going there, there must be written the language you need (English). choose the button again - create a new translation.

And it must display those lines that it did not display for the first time, or were deleted, at the very end of the file.

Try to do it again.

###############

And then why so highlight the voice ...?
He and without brackets will be displayed.

Voice as the image can be replaced by exactly the same

Suppose your file is in the folder
images/menu.png

You create the same folder in the translation folder and throw the necessary file there. In this case

tl/english/images/menu.png

And so with voices

label start:
.... voice "02.ogg"
.... ger "blabla"

It's enough.

https://www.renpy.org/doc/html/translation.html
I know, I'm writing terribly in English.

I'm writing a Renpy textbook (in Russian). https://yadi.sk/d/ZX_DonP63USRru Update 22.06.18

Honest Critique

User avatar
ComputerArt.Club
Veteran
Posts: 409
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Random content tagged with _("content") still not showing up for translation

#3 Post by ComputerArt.Club » Sat Jul 20, 2019 12:39 pm

Thanks so much for your reply Andredon, I tried something like your translation, getting it to replace the old translation and redo the whole thing, and it looks promising, though I will need to repaste in all the translations and I haven't verified that everything is there yet.

Andredron wrote:
Fri Jul 19, 2019 2:53 am

###############

And then why so highlight the voice ...?
He and without brackets will be displayed.

Voice as the image can be replaced by exactly the same

Suppose your file is in the folder
images/menu.png

You create the same folder in the translation folder and throw the necessary file there. In this case

tl/english/images/menu.png

And so with voices

label start:
.... voice "02.ogg"
.... ger "blabla"

It's enough.

https://www.renpy.org/doc/html/translation.html
Sorry, I forgot to mention that the voice file is part of the screens, so it doesn't seem to be automatically added to the translated scripts.

My current version looks like this:

Code: Select all

on "show" action Queue ("voice", _([quiz_voice]))
If I add quotation marks it shows up on the translated version of the script, but it also crashes the game when the script is run.
The default language(English) also works like this:

Code: Select all

on "show" action Queue ("voice", [quiz_voice])
I think I need to translate it to something like [quiz_voice!t] though it looks like this is a special case situation.
The names for the individual recordings show up in the script and have been translated, but that doesn't do anything, the same was true for the text based variables until I translated variables to [variable!t]

User avatar
ComputerArt.Club
Veteran
Posts: 409
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Random content tagged with _("content") still not showing up for translation

#4 Post by ComputerArt.Club » Tue Jul 23, 2019 11:56 am

I was going to post here again as there were a lot of things not showing up in the translation files, but I think I have figured that out.
https://www.renpy.org/doc/html/translat ... anslations
"Interface translations are a 1-to-1 substitution. Wherever a string is found, it will be replaced by a single replacement."
"When the same string is used in multiple places, the string can be distinguished using the {#...} text tag."
So you can still replace them individually with that tag. I haven't finished repasting in translations for the new version yet, but hopefully that will account for any of the words that appear to be missing in the translation file of the new version. I'll mark this as solved for now, even though I can't be certain that the problem is resolved, I can just reopen it later if necessary.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Imperf3kt, liagel