Author Topic: [SOLVED] Translation: same original sentence, but two different meanings  (Read 413 times)

Hi guys,
I'm currently working on the translation of my game, and I ran into an issue.

I have the same string in two places, but the translation needs to be different. And the .trs file only lists one.

The string is "Music" - one is in the Options screen, so it will be translated to "Musica", but the other one is an in-game sentence, where it should be "La musica".

How can I solve this? Is there a way of putting non-printable characters into the code?

A workaround I thought of is changing one of the two sentences to something like "BLAHBLAHBLAH" and add an English translation to bring back the original value, but this is something I'd like to avoid. Any pointers?
« Last Edit: 07 Feb 2020, 12:26 by guga2112 »

The string is "Music" - one is in the Options screen, so it will be translated to "Musica", but the other one is an in-game sentence, where it should be "La musica".

In this particular example, cannot english sentence also include an article? Like "A music" or "The music"?

In general, when above approach does not apply, I know only one workaround for this problem: use voice-over tags. They should not cause any trouble if you don't have any voice-over and be ignored, but they will become a part of the string key for translation.

For example: "&1 Music" and "&2 Music". Or "Music" for GUI setting and "&1 Music" for in-game sentence (because GUI are usually not voiced over).
« Last Edit: 06 Feb 2020, 19:38 by Crimson Wizard »

Unfortunately, the assumption is flawed from the get-go that source terms and target terms are in n:1 correspondence. There's the grammar angle: The translation might need to be declined dependent on the context, which might require different articles in the translation as well as different word spellings.

English "bear"; German "Der Bär" / "des Bären" / "dem Bär," / "den Bären" depending on the context.

And there are cases where one term in the source language corresponds to completely different terms in the target language, never mind the article.
German: "Mutter", English "nut" / "mother" dependent on the context
English "scales"; German "Schuppen" / "Waage", dependent on the context.

If there are only a few ambiguous terms in your code, you might get by by using "scalesX" and "scalesY" in your code and then cutting off the last letter before showing the word on screen. Then the translators can convert "scalesX" to "SchuppenX" and "scalesY" to "WaageY", so that the right thing happens when the last letter is cut off. Or, using the code (N)ominative, (G)enitive, (D)ative, (A)ccusative, put "bearN", "bearG", "bearD"; "bearA" in the code and let them be translated to "der BärN", "des BärenG", "dem BärD", "den BärenA", respectively. However, there are still some cases where the target language uses different grammar cases than the source language: English "I (nominative) can't think of anything!" German "Mir (dative) fällt nichts ein!" French "Je (nominative) n'en ai aucune idée".

Or else, simply ignore the issue and provide bad translations. I seem to recall that most of the classic Point & Click games treated the Germans with poetic gems such as "Benutze Der Zahnbürste mit Der Bär", and nobody seemed to mind much.

By the bye: Translation friendly code should always prefer patching full sentences to piecing together parts. For instance, if you code
Code: Adventure Game Studio
  1. String verb = "take";
  2.     String thing = "hammer";
  3.     String s = "Should I " + verb " the " + hammer + "?";
then the translator might find that they ought to move the pieces around in the translation, but can't.
English: Should I take the hammer?
German: Soll ich den Hammer nehmen?
Or the typographic conventions differ, note the space before the question mark:
French: Il faut prendre le marteau ?

On the other hand, if you code
Code: Adventure Game Studio
  1. String s = "Should I <verb> the <thing>?"
... and then replace "<verb>" by the verb and "<thing>" by the thing,
then the German translator can translate that to : "Soll ich <thing> <verb>?" (changing the sequence), and the French translator to "Il faut <verb> <thing> ?" (adding the space).
Note that this, right here, is an instance where you have to deal with articles and grammatical cases in some way, too. "thing" might turn out to be male, female or neuter in different languages, and it will probably turn out to be accusative here, but nominative elsewhere.

Internationalization is harder than it seems at first glance.
« Last Edit: 06 Feb 2020, 22:53 by fernewelten »


  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
since it's your game, there's also the option to add an invisible character to one of the texts.




(If you can't see the difference, highlight the words. I added a space to the end of the second word.)

So then you could translate



La Musica

Because AGS sees the space character as just another character.
The other option is to tell AGS to treat each entry as one new entry, even if the words/sentences are exactly the same.
There are those who believe that life here began out there...

Thank you all.

In the end, it was only just that one, which I solved as Cassiebsg suggested: on the GUI I just put "Music ", my label looks exactly the same, but I get two different translation entries.

I like the AGS translation system - it's pretty fast and simple, but this is quite a limitation. I have an idea for an improvement, but I don't have the time now to look into it. I'll post it on the appropriate subforum :)

Thanks again!