BUG:(AGS 3.1.2) Translations

Started by Joe, Mon 18/05/2009 20:02:50

Previous topic - Next topic

Joe

I made a game using AGS 3.1.2 and then I translated it, when I tested the game with the traslation it just worked with Display function and some other, so I had to make english the default language of my game...

Sorry if this has already been said.
Copinstar © Oficial Site

Pumaman

You'll have to be more explicit about the problem, there are no known issues with translations that I'm aware of.

Joe

Ok. I translated my Spanish game into English and compiled the translation source. Then I selected the English translation in the winsetup.exe and played my game. But most of the texts were still in Spanish.
I really don't know why did this happen but I can sure you I used the source correctly and as I've seen in this game: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37800.0 it's not only my problem so I decided to post it.

Joe.
Copinstar © Oficial Site

Pumaman

Can you give an example of one scripting line where it doesn't translate the text?

In the Alien: Puzzle Invasion game that you linked to it looks like lots of the text is part of the background image (which wouldn't be translated for obvious reasons).

GarageGothic

Are you only using the standard Say, Display, Label.SetText and similar commands? If you're using a module or other custom functions that somehow parse the String before displaying it (for instance I have code that linebreak Strings and then call DrawString on the individual lines)? If so, you have to replace the original String with the translated version using  "GetTranslation(string original)" before changing it.

Joe

QuoteCan you give an example of one scripting line where it doesn't translate the text?
Code: ags

void UpdateState(){ 

  if(life<=100)lVida.TextColor=2016;
  if(life<=80)lVida.TextColor=52576;
  if(life<=50)lVida.TextColor=54272;
  if(life<=20)lVida.TextColor=63488;
  if(life<=0)Vida=0;
  if(life>100)Vida=100;
  lLife.Text=String.Format("VIDA: %d %",Vida);
  lBullets.Text=String.Format("BALAS: %d/%d",Balas, TotBalas);
  if(life<=0){
    Wait(20);
    Display("Joseda y sus secuaces han podido contigo");
    RestartGame(); 
  }
  
}


Those lines are not translated...

QuoteIn the Alien: Puzzle Invasion game that you linked to it looks like lots of the text is part of the background image (which wouldn't be translated for obvious reasons).
Hmm I see. Then it's just my problem again

Quote
Are you only using the standard Say, Display, Label.SetText and similar commands? If you're using a module or other custom functions that somehow parse the String before displaying it (for instance I have code that linebreak Strings and then call DrawString on the individual lines)? If so, you have to replace the original String with the translated version using  "GetTranslation(string original)" before changing it.

Hmm you can see it in my code, anyway I think that's the reason it's not working...

However I don't know what you really mean by replacing the original String with the translated version[...]
Copinstar © Oficial Site

Khris

Try this:

Code: ags
  lLife.Text = String.Format(GetTranslation("VIDA: %d %"), Vida);
  lBullets.Text = String.Format(GetTranslation("BALAS: %d/%d"), Balas, TotBalas);


I'm not sure if this is the way GetTranslation is supposed to be used here though.

Pumaman

Quote from: Joe Carl on Tue 19/05/2009 12:35:19
  lLife.Text=String.Format("VIDA: %d %",Vida);
  lBullets.Text=String.Format("BALAS: %d/%d",Balas, TotBalas);

Can you post the lines from your translation source file that attempt to translate these texts? (ie. both the Spanish and English versions)?

Did you leave all the %d and % signs intact in the English translation?

Joe

Quote from: Pumaman on Tue 19/05/2009 19:22:02
Quote from: Joe Carl on Tue 19/05/2009 12:35:19
  lLife.Text=String.Format("VIDA: %d %",Vida);
  lBullets.Text=String.Format("BALAS: %d/%d",Balas, TotBalas);

Can you post the lines from your translation source file that attempt to translate these texts? (ie. both the Spanish and English versions)?

Did you leave all the %d and % signs intact in the English translation?


Here it is:

VIDA: %d %
LIFE: %d %
BALAS: %d/%d
BULLETS: %d/%d


-----

I'll try what Khris said as soon as I can
Copinstar © Oficial Site

Pumaman

Hmm, that should work... String.Format should automatically apply the translation. I'll see if I can replicate it.

Dualnames

I found a crash thing. I was going to make a translation into a default language but the engine (3.1.2) won't let me make it into default and instead appears this error message. Apparently something is messed up. Thing is anyone care to find it here?


http://ledzepforever.googlepages.com/proofread.trs

Or at least tell me what to look for. :(
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Pumaman

Well, what's the error message?

If extra lines have been added to the file by hand it's possible there is a duplicate line in there, which I think I have seen cause errors in the past.

Dualnames

Quote from: Pumaman on Tue 26/05/2009 18:01:26
Well, what's the error message?

If extra lines have been added to the file by hand it's possible there is a duplicate line in there, which I think I have seen cause errors in the past.


Ah, crap I thought I posted the message..

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Pumaman

Thanks. It looks like this is a bug in the AGS Editor if two different source lines in the file map to the same translation.

For example, in this file there is:
"Heart Of Gold" -> "Heart Of Gold"
"Heart of gold" -> "Heart Of Gold"
and probably others too.

I'll fix it in a future version.

Dualnames

Quote from: Pumaman on Wed 27/05/2009 18:34:09
Thanks. It looks like this is a bug in the AGS Editor if two different source lines in the file map to the same translation.

For example, in this file there is:
"Heart Of Gold" -> "Heart Of Gold"
"Heart of gold" -> "Heart Of Gold"
and probably others too.

I'll fix it in a future version.

Seems I can't finish the game if you don't. Well, ok, no worries, thanks for the support. It's really appreciated.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Leon

Quote from: Dualnames on Fri 29/05/2009 10:24:33
Seems I can't finish the game if you don't. Well, ok, no worries, thanks for the support. It's really appreciated.

What happens when you 'manually' correct the lines as if they were original? So move the translated line one line up and leave the one below it blank.. Is that maybe a workaround for the time being? Just act as if they don't need to be translated?

Ultimate Game Solutions - Because there is a solution for everything

Dualnames

Quote from: Leon on Fri 29/05/2009 13:04:29
Quote from: Dualnames on Fri 29/05/2009 10:24:33
Seems I can't finish the game if you don't. Well, ok, no worries, thanks for the support. It's really appreciated.

What happens when you 'manually' correct the lines as if they were original? So move the translated line one line up and leave the one below it blank.. Is that maybe a workaround for the time being? Just act as if they don't need to be translated?



I might however misplace a line.. and then cause more chaos.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Sektor 13

Hey, I'll use this thread.
I tried to compile new translation but i get the following mesasge:

--------------------------------------------------------------------------------------------------
Error: Input string was not in a correct format.
Version: AGS 3.1.0.59

System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at AGS.Types.Translation.ReadOptionalInt(String textToParse)
   at AGS.Types.Translation.ReadSpecialTags(String line)
   at AGS.Types.Translation.LoadData()
   at AGS.Editor.Components.TranslationsComponent.CompileTranslation(Translation translation, CompileMessages errors)
   at AGS.Editor.Components.TranslationsComponent.CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMenuClick(String menuItemID)
   at AGS.Editor.ProjectTree.ContextMenuEventHandler(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
-------------------------------------------------------------------------------

What could cause this kind of a problem ?
I got some older transaltion file that works fine...

Pumaman

Quote from: Sektor 13 on Sun 31/05/2009 20:55:58
Hey, I'll use this thread.
I tried to compile new translation but i get the following mesasge:

The special #NormalFont and #SpeechFont lines must be set to a font number. If you've changed them in this translation file to have a font name, or something that isn't a font number, then this error could result.

Dualnames

CJ we're going to trace the problem with leon, so when we do we'll post it here, if that's ok.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk