News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Help window Index - language and encoding mixup

Started by Vladki, January 11, 2021, 08:52:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladki

Hello,

as I was looking a bit more at translations, I found out that the index of help file does not follow the translations exactly:

1. (as shown in attached screenshot) - if you switch languages, some items stay in the language that was active on start of program. In this case - game started in Czech, then switched several languages and ended up in German. The same happens also with western languages - start in english, switch to german, and the index will be half english, half german. It has nothing to do with the fact if the referenced help file is translated or not.

2. when the language is Czech - some items are shown properly in iso-8859-2 font, but some are in iso-8859-1. It seems there is some correlation with those that stay in the first language, but I'm not sure. Slovak and Polish seem to be OK.

3. in Slovak language most of the help texts are show in iso-8859-1 font (instead of 8859-2). Czech and Polish seem to be OK...

So the question is - where is the charset for each language specified? I see font specification in xx.tab, but CZ, SK and PL have the same:

PROP_FONT_FILE
prop-latin2.fnt


I was trying to find out the translation file/template for the help index but found only this:
https://translator.simutrans.com/script/edit.php?obj_id=56145&index=0

Is that all? That seems to define only the main chapters of index, but not the names of individual topics. They seem to be generated. But where and how can I fix them?

prissi

#1
First: Please give me the exact steps to recreate this. I could not. Each time the help window is opened, it rebuilds the language strings.

Second: Czech display seems broken in the left side of the Index. "Napovida - my1" instead "Napoveda - mys" when using the wrong Latin2 font by manual selection. However, I could not find this string in the translation files ... Any hint will greatly help with debugging.

There should be only unicode internally but these seem to stay in Latin2. (The prop-latin2.fnt is internally replaced by cyr.bdf.)

makie

Quote from: prissi on January 12, 2021, 12:38:58 AMThere should be only unicode internally but these seem to stay in Latin2. (The prop-latin2.fnt is internally replaced by cyr.bdf.)
We can change the output of the translator to UTF-8.
For these language or for all of language.
This can be changed here:
https://makie.de/translator/script/admin.php?action=language
That just changes the output. From my point of view or from the perspective of the translator, this can be changed at will.
I just didn't dare to change it, because I don't know the effects on the Simutrans program.

Dwachs

These section names are taken from the title in title-tags of the corresponding txt-helpfiles
Parsley, sage, rosemary, and maggikraut.

prissi

The titles are extracted before the file is recoded. This requires some more effort. The content is correctly converted on loading (albeit for other languages some more characters needs to be checked.) Still getting offtopic from the initial error.

Vladki

Quote from: prissi on January 12, 2021, 12:38:58 AMFirst: Please give me the exact steps to recreate this. I could not. Each time the help window is opened, it rebuilds the language strings.
For me it works like this:
- start the game, load any game or just stay with the demo.sve, savegame or pakset does not matter
- press F1, check that the help is all in current language, close help
- switch languages
- press F1, check that the topics on left side are mixed especially the tools/werkzeuge part.
I have downloaded fresh nightly including the support files (text, themes, etc) and deleted all xml and sve files, so there should not be any leftovers

Quote from: prissi on January 12, 2021, 12:38:58 AMSecond: Czech display seems broken in the left side of the Index. "Napovida - my1" instead "Napoveda - mys" when using the wrong Latin2 font by manual selection. However, I could not find this string in the translation files ... Any hint will greatly help with debugging.
Quote from: Dwachs on January 12, 2021, 07:53:11 AMThese section names are taken from the title in title-tags of the corresponding txt-helpfiles
That's what I see too (and reported as point 2). I have checked all txt helpfiles, and they are properly encoded in iso-latin-2, yet some of the titles are shown using latin-1 font.

I can try exporting files from translator in UTF-8, but still wonder why Polish is OK (and uses iso-latin-2 too).

prissi

#6
The left index changes in my tests in the same language that I select, no matter if I start in Czech or in German.

EDIT: r9558 shopuld fix the index display error with latin2 languages.

Dwachs

compiler warns about unused variable:

gui/help_frame.cc:443:12: warning: unused variable 'cc' [-Wunused-variable]
                                        utf32 cc = utf8_decoder_t::decode(c, len);

not sure, what to do here.
Parsley, sage, rosemary, and maggikraut.

prissi

That was from too much copy and paste. We do not need the return value.

Vladki

I confirm that issues 2 (nápověda - myš) & 3 (slovak help texts) are fixed. But the issue #1 still remains. Now I have started the game in german, help index was all in german. Then switched to english, polish, czech, slovak, and about half  of the tools index was still in german.

prissi

Please name a tool that stays the same. Because I cannot reproduce it. After closing and opening the help window, everything is in the same language.

Vladki

I have downloaded fresh pak64 (using get_pak.sh) to avoid any pak related problems.
Game started in Slovak, switch to English. These topics remained in slovak: Landscaping tools, Railroad tools, monorail tools, tram/light rail tools, road tools, shipping tools, airport tools, narrow-gauge tools, special tools, map editing tools.
Second try - pak128, game started in english, switch to german - same topics remained in english.

Ohh. I noticed that If I have some of the above mentioned toolbars open, then the menu index is correctly translated - but only for those that are open.  So, finally steps to reproduce:

load a game, close all toolbars, check F1 help, close, change language, check F1 help (should be mixed), close
open some toolbars, check F1 - those toolbars that are open should be in correct language

prissi

So I choose the easiest option in r9582: Selecting a new language will just close all open windows ...

Vladki

#13
Yeah that will help when switching between latin-1 and latin-2 languages. I will try the help index later.

The help index is still mixed language after that. You have to _OPEN_ all toolbars to fix it. Not close them.

prissi


Vladki