Page 1 of 1

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

Posted: Fri Jul 19, 2019 2:34 am
by ComputerArt.Club
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. :)

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

Posted: Fri Jul 19, 2019 2:53 am
by Andredron
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

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

Posted: Sat Jul 20, 2019 12:39 pm
by ComputerArt.Club
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]

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

Posted: Tue Jul 23, 2019 11:56 am
by ComputerArt.Club
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.