Translation of %s

Started by Sledgy, Fri 27/06/2014 00:42:32

Previous topic - Next topic

Sledgy

I got a problem with it


For example, there's code
Code: ags
String a, b;
a="Lamp";
b="Cup";


Display("Use %s to %s", a,  b);



It needs for hint of using objects


In the TRA I translated this lines

'Lamp' and 'Cup' --- to --- 'La lampa' and 'Le cupp'

'Use %s to %s' --- to --- 'Mix %s with %s'


But in the game I have 'Mix Lamp with Cup'

i.e. Strings (%s) weren't translated. Though they exist in the TRS (!)

Sledgy

#1
I checked Descriptions of objects and inventory items instead of it. And translation works


But in one game I have trouble with it

I pick up item from my inventory, hint (GUI Label) appears 'Use %s to %s'. Mouse is on the item

And it's incredible. 1-st %s isn't translated, but 2-nd is translated. But really it's the same game object


For example, Lamp. I must got 'Mix La lampa with La lampa' in the hint

But I got 'Mix Lamp with La lampa'

Strangely. In the code this description (Lamp) exists only in one place. I checked it - I renamed Lamp to L2mp in the hex (and in the TRA)

And got 'Mix L2mp with La lampa'

-----------------

Seems, it's bug of WF2-engine (some 3.x, dunno). 'cause I checked 3.2.1 and everything work

Sledgy

#2
With engine 3.3.0 alpha2 it works normally too. But there isn't WF2 font support, but there's extended WFN (256 symbols)

How to add WF2 to it? Or how to convert WF2 to extended WFN?

Who is the author of WF2-engine?

//

3.3.1 alpha 1 doesn't work, because of problem with run --- 'Unable to load font 2, no renderer could load a matching file'

Crimson Wizard

#3
The solution is to use "GetTranslation" function:
Code: ags

Display("Use %s to %s", GetTranslation(a),  GetTranslation(b));



Regarding the rest...
What is WF2?
What is 3.3.0 alpha2 ??
Also, if you think there's a bug in 3.3.1, please report in 3.3.1 thread, this will be easier to track.


Sledgy

I learned, WF2 is Russian clone of WFN ext with a little another header. It's created for special engine - acwin.exe with WF2-support

3.3.0 alpha 2, at least, is 3.4.0 ---- AGS 3.4.0 Early Alpha: http://www.adventuregamestudio.co.uk/forums/index.php?topic=48629.0

At least, it's not bug of 3.3.1. It's ok


I found decision. I just got Russian WFN ext fonts

Crimson Wizard

#5
I believe it may be possible to write a plugin which would add extra font support (WF2), if you know the data format.
There's an example of font plugin: SpriteFont by Calin Leafshade (https://github.com/CalinLeafshade/ags-spritefont)

PS. Please don't use 3.4.0, it is in alpha stage and we do not provide support for it yet.
The latest "official" release is 3.3.0 update1: http://www.adventuregamestudio.co.uk/forums/index.php?topic=50021.0
Next release (in alpha stage too, but quite stable) is 3.3.1.
3.4.0 is only planned for future.

SMF spam blocked by CleanTalk