Dialogs don't change to another language. (SOLVED)

Started by PERXEO, Thu 11/05/2023 18:53:18

Previous topic - Next topic

PERXEO

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.

Code: ags
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?

Crimson Wizard

#1
When you say "dialogues", do you mean a Dialog script and options, or something else? Can you show an example of a dialogue?

PERXEO

Hi CRIMSOM!
Thanks for your answer. I refer to this kind of dialogs



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)

Crimson Wizard

#3
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?


PERXEO

My default language is spanish in the game.

Crimson Wizard

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?

PERXEO

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;

PERXEO

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....

Crimson Wizard

#9
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:
Code: ags
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!!".

PERXEO

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!!!

SMF spam blocked by CleanTalk