Adventure Game Studio | Forums

AGS Support => Advanced Technical Forum => Topic started by: strazer on Sun 11/04/2004 20:25:41

Title: Tracker: NoTranslate
Post by: strazer on Sun 11/04/2004 20:25:41
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
Title: Re:Translation output of default hotspots names?
Post by: Pumaman on Sun 11/04/2004 22:09:48
QuoteCouldn'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.

QuoteEdit: 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.
Title: Re:Translation output of default hotspots names?
Post by: strazer on Sun 11/04/2004 22:23:13
QuoteSounds reasonable enough, I'll add it to my list.

Thank you!

QuoteThere'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?
Title: Re:Translation output of default hotspots names?
Post by: Pumaman on Sun 11/04/2004 22:24:54
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).
Title: Re:Translation output of default hotspots names?
Post by: strazer on Sun 11/04/2004 22:30:37
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:

Quoteany 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.
Title: Re:Translation output of default hotspots names?
Post by: Pumaman on Mon 12/04/2004 18:41:27
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.
Title: Re:Translation output of default hotspots names?
Post by: strazer on Mon 12/04/2004 20:44:32
string NoTranslateProperty(string text) {
return text;
}

Works great, thank you! :)