Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: PERXEO on Thu 11/05/2023 18:53:18

Title: Dialogs don't change to another language. (SOLVED)
Post by: PERXEO on Thu 11/05/2023 18:53:18
Hi everyone!!
I have another small problem with translations and audios in other languages.
I have these two codes, associated with two buttons for the English and Spanish language in the status bar. They are to change languages ��during the game.

function btnSpanish_OnClick(GUIControl *control, MouseButton button)
{
    Game.ChangeTranslation("Spanish");
    translation = "Spanish";
    Game.ChangeSpeechVox("Spanish");
    player.Say("A partir de ahora, todo será en Español");
    gControl.Visible=false;
   
}

function btnEnglish_OnClick(GUIControl *control, MouseButton button)
{
    Game.ChangeTranslation("Ingles");
    translation = "Ingles";
    Game.ChangeSpeechVox("Ingles");
    player.Say("From now on, everything will be in English");
    gControl.Visible=false;
}

Everything works "quite" well except that the dialogues do not change to English when I activate English as the language. However, all the rest of the texts, descriptions, player.Say("xxxx")...etc work perfectly. I have followed all the steps that come in the tutorial but no matter how much I compile over and over again and check the .trs files I can't find the solution.

Should I do something else, for the dialogs to change to the chosen language?
Title: Re: Dialogs don't change to another language.
Post by: Crimson Wizard on Thu 11/05/2023 19:41:52
When you say "dialogues", do you mean a Dialog script and options, or something else? Can you show an example of a dialogue?
Title: Re: Dialogs don't change to another language.
Post by: PERXEO on Thu 11/05/2023 20:25:05
Hi CRIMSOM!
Thanks for your answer. I refer to this kind of dialogs

(https://www.flowingbytes.com/ags/dialogs.jpg)

When I change the idiom with the previous code, those dialogs don't change from spanish to english, but the document english.trs it's ok (or at least I think so)
Title: Re: Dialogs don't change to another language.
Post by: Crimson Wizard on Thu 11/05/2023 20:28:17
You say it's "english.trs", but in script posted above you have Game.ChangeTranslation("Ingles")?

Another question that I have because I do not know Spanish, what is the default language in your game, the one you have in scripts and editor? Is it not the spanish already?
Title: Re: Dialogs don't change to another language.
Post by: PERXEO on Thu 11/05/2023 20:30:26
Of course... here is:
(https://www.flowingbytes.com/ags/trs.jpg)
Title: Re: Dialogs don't change to another language.
Post by: PERXEO on Thu 11/05/2023 20:33:01
My default language is spanish in the game.
Title: Re: Dialogs don't change to another language.
Post by: Crimson Wizard on Thu 11/05/2023 20:34:38
Quote from: PERXEO on Thu 11/05/2023 20:30:26Of course... here is:

You do not need to insert numbers there (like "1:", "2:"...), if they are not part of the text.
Did you edit the key lines in TRS yourself?

Quote from: PERXEO on Thu 11/05/2023 20:33:01My default language is spanish in the game.

Something that I find strange in your example, if you already have Spanish in the game itself, then why do you need a separate Spanish translation?
Title: Re: Dialogs don't change to another language.
Post by: PERXEO on Thu 11/05/2023 20:37:23
QuoteSomething that I find strange in your example, if you already have Spanish in the game itself, then why do you need a separate Spanish translation?

Good question...maybe this is part of the problem. But if I have to refer to spanish language and this is the default idiom...how must I refer to it?
Something like that???

Game.ChangeTranslation("dafault");
    translation = "default";
    Game.ChangeSpeechVox("default");
    player.Say("A partir de ahora, todo será en Español");
    gControl.Visible=false;
Title: Re: Dialogs don't change to another language.
Post by: PERXEO on Thu 11/05/2023 20:38:38
QuoteDid you edit the key lines in TRS yourself?
No...but I changed the lines on the dialog, as you can see on the first image i posted....
Title: Re: Dialogs don't change to another language.
Post by: Crimson Wizard on Thu 11/05/2023 20:42:02
Quote from: PERXEO on Thu 11/05/2023 20:37:23
QuoteSomething that I find strange in your example, if you already have Spanish in the game itself, then why do you need a separate Spanish translation?

Good question...maybe this is part of the problem. But if I have to refer to spanish language and this is the default idiom...how must I refer to it?

You pass an empty line:
Game.ChangeTranslation("");

Quote from: PERXEO on Thu 11/05/2023 20:38:38
QuoteDid you edit the key lines in TRS yourself?
No...but I changed the lines on the dialog, as you can see on the first image i posted....

The translation will not work if the key lines are different from the text in game.
You must do translation Update if you edit or add new lines.
Alternatively, you could edit them by hand, if there are only few modified lines.

But in any case, the key lines must match the game. So if in game's dialog you have "&1 Hola Jerry!!", then in TRS you should have exactly "&1 Hola Jerry!!", not "1: Hola Jerry!!".
Title: Re: Dialogs don't change to another language.
Post by: PERXEO on Thu 11/05/2023 20:45:07
Thank you very much!! I have to rethink this, because you are absolutely right. There are inconsistencies between the dialogs and the trs file....you can't imagine how long I've been looking at this. Thanks for your time!!!