Opened 17 years ago

Last modified 3 years ago

#7564 pending feature request (pending)

FOTAQ code modifications (mostly for greek translation)

Reported by: SF/greekroms_vag Owned by: sev-
Priority: normal Component: Engine: Queen
Version: Keywords:
Cc: Game: Flight of the Amazon Queen

Description

Hello. I am translating FOTAQ in greek and I'd like to ask for some modifications in the code. Unfortunatelly I don't know C++...

The first change has to do with the strings of Joe's actions (open, close, move, etc.). In greek, it will be something like "talk t" instead of "talk to", "look a" instead of "look at", and so on. (That last letter, together with the article of the object, which will be part of the object's string, makes a new article, in genitive). The problem is that the program itself always adds a space after these strings. Cyx has already wrote some code so that in these cases (and in greek version only), there won't be this space.

This would look perfect when you select these actions and the mouse is over an object When the mouse pointer isn't over an object though, it will say "talk t", "look a", which doesn't make sense. It would be better to say "talk", "look", instead. Is it possible that when there's no object, only the first word of the string shows, and when there's an object, the whole string? (Only in the greek version of course).

The next changes would be useful for all versions:

The next thing has to do with the fact that phrases are usually longer in greek than in english, plus there are always the articles of the objects... In many cases, the produced string on the screen is longer than the screen width, so you can't see all of it! Cyx told me that this happens in the original french version as well. In many cases, I can just change the text to something shorter, but not always. In the case when the text is really too long, it should appear in two lines,without changing the height of the black area. The font is 8 pixels tall, so if we want two lines, we need 16 pixels. Because the black area is 10 pixels tall, we really need another 6. If 3 pixels of the font appear over the graphics, above, and another 3 appear over the game buttons and inventory, below, it won't look too bad. In the case when there are two lines of text, they should be of about the same length. It wouldn't be nice to have a really long line and then one or two words.

There's also a minor thing with the action screen area: the last 8 pixels are always black. There's at least one case when the phrase would (barely) fit on the screen, but you can't see the last letter (see attached image). Could that also be fixed?

Ticket imported from: #1723255. Ticket imported from: feature-requests/380.

Attachments (2)

FOTAQ1.PNG (44.6 KB ) - added by SF/greekroms_vag 17 years ago.
Example of the black last 8 pixels in the action screen area
fotaq_greek.patch (17.0 KB ) - added by bluegr 17 years ago.
Add support for the Greek fan translated version of FOTAQ

Download all attachments as: .zip

Change History (10)

by SF/greekroms_vag, 17 years ago

Attachment: FOTAQ1.PNG added

Example of the black last 8 pixels in the action screen area

by bluegr, 17 years ago

Attachment: fotaq_greek.patch added

Add support for the Greek fan translated version of FOTAQ

comment:1 by bluegr, 17 years ago

I've made a patch to support the Greek fan translation of this game, with the following changes: * The Greek language is added to the list of the supported ScummVM languages * Greek font is added in FOTAQ * When the verb is "Go to" in the Greek version, there won't be a space after the verb and the item * The strings in the journal are not cut off in the Greek version (else we get an assertion, as one of the translated strings is a bit longer than it should) * I didn't get the glitch reported with the action area, the verb and the command are shown normally for me

I don't know about the text wrapping feature request, I need to have a savegame where this occurs. Perhaps Cyx implemented this already?

If noone has any objections, could I submit this patch? File Added: fotaq_greek.patch

comment:2 by cyxx, 17 years ago

vag, where can I get your translation patch ?

thebluegr, I only have one remark about your patch :

+ if (_vm->resource()->getLanguage() != Common::GR_GRE) + drawPanelText(y + 12, Common::trim(buf)); + else + drawPanelText(y + 12, buf); // don't trim panel text in Greek version

trim() should only remove leading and trailing spaces, so the resulting string width can be <= than the original. Which assertion do you get with it ?

Other than that, nice work, feel free to commit this (if the translation is not yet available, please mention it in the commit message, ie. something like "patch #1723255: add changes for upcoming Greek translation")

comment:3 by bluegr, 17 years ago

cyx, I get the following assertion with trim, when opening the control panel: File: isctype.c line 56 Expression: (unsigned)(c+1) <= 256

Corresponding code inside isctype.c is: extern "C" int __cdecl _chvalidator( int c, int mask ) { _ASSERTE((unsigned)(c + 1) <= 256); return _chvalidator_l(NULL, c, mask); }

And here's the stack trace: scummvm.exe!_chvalidator(int c=-94, int mask=8) Line 56 + 0x2a bytes C++ > scummvm.exe!isspace(int c=-94) Line 189 + 0xb bytes C++ scummvm.exe!Common::ltrim(char * t=0x0012e9cc) Line 460 + 0xc bytes C++ scummvm.exe!Common::trim(char * t=0x0012e9cc) Line 473 + 0x9 bytes C++ scummvm.exe!Queen::Journal::drawPanel(const int * frames=0x010dc36c, const int * titles=0x010dc37c, int n=3) Line 433 + 0xc bytes C++ scummvm.exe!Queen::Journal::drawNormalPanel() Line 442 C++ scummvm.exe!Queen::Journal::redraw() Line 155 C++ scummvm.exe!Queen::Journal::use() Line 66 C++ scummvm.exe!Queen::LogicGame::useJournal() Line 2121 C++ scummvm.exe!Queen::Command::updatePlayer() Line 299 + 0x29 bytes C++ scummvm.exe!Queen::QueenEngine::update(bool checkPlayerInput=true) Line 221 C++ scummvm.exe!Queen::QueenEngine::go() Line 376 C++ scummvm.exe!runGame(const Plugin * plugin=0x0200df80, OSystem & system={...}, const Common::String & edebuglevels={...}) Line 212 + 0x15 bytes C++

I think it's caused because c is negative here, but I don't know why it's negative. I guess abs can be used to turn it into positive, but still it shouldn't be negative in the first place

I'll commit the current code, so please feel free to edit it and see what's wrong with it

Vag gave me some links for the work in progress greek translation, but some of them are no longer available :( He uploaded the files to two servers, one server had half the files and the other one the other half - the files on one server are not there anymore :(

comment:4 by cyxx, 17 years ago

Ok, thanks for the backtrace.

The assertion is probably triggered because the char we're trying to test is > 128 (162 ?). Problem is that we're using isspace with a non standard, game specific, "ascii charset".

A possible way to fix this would be to define our own isspace() function and only test specific chars. ie. something like

#define isspace(c) strchr(" \n\r\t", c)

Not sure if other engines could benefit from this, though.

comment:5 by bluegr, 17 years ago

Your solution worked cyx, thanks :)

Is the text multi-line part of this feature request is already implemented?

comment:6 by cyxx, 17 years ago

I haven't done anything regarding the multi-line part. Original french/german versions have the same problem, the action sentence width is sometimes >= 320.

But I am not sure if splitting the lines is a good way to workaround this. Instead I was thinking of doing something like in SCUMM v7 : when the mouse cursor is hovering the sentence on the left, make it scroll horizontally on the right and vice versa.

comment:7 by csnover, 7 years ago

Component: Engine: Queen
Game: Flight of the Amazon Queen

comment:8 by sev-, 3 years ago

Owner: set to sev-
Resolution: pending
Status: newpending

Was this project for translating ever completed? If it was, what kind of support is still required from us?

Note: See TracTickets for help on using tickets.