Jibble

Author Topic: Tracker: NoTranslate  (Read 2881 times)

Tracker: NoTranslate
« on: 11 Apr 2004, 20:25 »
How do I hide a string from translation? I can't find a function like SkipTranslation(string text) or something.

Fixed since 2.61 Beta 5:

"Make translation source..." outputs the default names of my hotspots (No hotspot, Hotspot 1, Hotspot 2, etc.).

Couldn't AGS just skip the default names? I'd like to keep the translation file as compact as possible.

Thanks
« Last Edit: 25 Sep 2004, 21:42 by strazer »

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens King
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that won an AGS Award!
    •  
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re:Translation output of default hotspots names?
« Reply #1 on: 11 Apr 2004, 22:09 »
Quote
Couldn't AGS just skip the default names? I'd like to keep the translation file as compact as possible.

Sounds reasonable enough, I'll add it to my list.

Quote
Edit: Oh yeah, and how do I hide a string from translation? I can't find a function like SkipTranslation(string text) or something.

There's no special feature for this -- just don't translate that string and it will be unchanged.

Re:Translation output of default hotspots names?
« Reply #2 on: 11 Apr 2004, 22:23 »
Quote
Sounds reasonable enough, I'll add it to my list.

Thank you!

Quote
There's no special feature for this -- just don't translate that string and it will be unchanged.

I still don't think it's necessary to output property names and values that are used for the game mechanics and could potentially screw up the game if translated.
I think a function like SkipTranslation shouldn't be too hard to implement?

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens King
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that won an AGS Award!
    •  
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re:Translation output of default hotspots names?
« Reply #3 on: 11 Apr 2004, 22:24 »
I'm not really sure where you're thinking the SkipTranslation command would go?

Property names should not be exported (any text in a call to GetXXXProperty should not be in the translation file).

Re:Translation output of default hotspots names?
« Reply #4 on: 11 Apr 2004, 22:30 »
Sorry, of course, the properties and values themselves are not written, but I need to compare the returned string with a string, and THIS is the string I don't want to appear in the file, e.g.

GetHotspotPropertyText(GetHotspotAt(mouse.x,mouse.y),"IsExit",hotspotisexit);
if (StrCaseComp(hotspotisexit,"NE") == 0)
         ChangeCursorGraphic(MODE_WALK,64);

I don't want "IsExit" and "NE" to appear in the translation file.

Edit:

Quote
any text in a call to GetXXXProperty should not be in the translation file

As I said, I removed all hotspot names, and I checked my scripts again, "IsExit" is indeed from the GetHotspotProperty call.
« Last Edit: 11 Apr 2004, 23:06 by strazer »

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens King
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that won an AGS Award!
    •  
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re:Translation output of default hotspots names?
« Reply #5 on: 12 Apr 2004, 18:41 »
Ah - it only scans backwards 10 characters to check for the "GetxxxProperty", so since you've got a GetHotspotAt call in there it hasn't realised.

What you could do is a bit of a hack, like this:

function NoTranslateProperty(string text) {
  return text;
}


then do:

if (StrCaseComp(hotspotisexit, NoTranslateProperty("NE")) == 0)

because the function name ends in "Property", the editor will ignore it for translation purposes.

Re:Translation output of default hotspots names?
« Reply #6 on: 12 Apr 2004, 20:44 »
string NoTranslateProperty(string text) {
return text;
}

Works great, thank you! :)
« Last Edit: 12 Apr 2004, 20:48 by strazer »