text menu items are Shift when the translated string is long.

Please report only one bug per message!

Moderators: sheep, Hacker, Stefan2, white

Post Reply
krapet
Junior Member
Junior Member
Posts: 20
Joined: 2007-08-02, 06:39 UTC
Location: Czech

text menu items are Shift when the translated string is long.

Post by *krapet » 2019-10-16, 13:43 UTC

I discovered this error when I tried to edit an existing translation (WCMD_EN.LNG file).

Sometimes the full translation may not be completely understandable and it may be useful to know the English original, which I tried to add.
I modified the strings 1579 and 1580.

Although the change was syntactically correct, the contents of the displayed menu were incorrect.
Some chains were completely different than I expected. As if they were used in another part.
This extra shift can also cause one extra embedded character.

It seems that the reason is the length of the translated string.

OK for:

Code: Select all

1579="Celý název|Název|Přípona|comment (komentář)|Velikost|creationdate (vytvoření)|creationtime (vytvoření)|writedate (úprava)|writetime (úprava)|accessdate (přístup)|accesstime (pří)|Atributy číselnou hodnotou|Atributy písmeny|Archivovat|Jen pro čtení|Skrytý|Systémový"
1580="compressed (komprimovaný)|encrypted (šifrovaný)|sparse (zřídka)|Označení verze|Číslo verze|Typ souboru|bajty|kilobajty|megabajty|gigabajty|Datový soubor|Složka|Bod změny zpracování|Název v systému DOS|Cesta|Složka (atribut)|Offline"
After adding one character, the menu items have been shifted by one text:

Code: Select all

1579="Celý název|Název|Přípona|comment (komentář)|Velikost|creationdate (vytvoření)|creationtime (vytvoření)|writedate (úprava)|writetime (úprava)|accessdate (přístup)|accesstime (přís)|Atributy číselnou hodnotou|Atributy písmeny|Archivovat|Jen pro čtení|Skrytý|Systémový"
1580="compressed (komprimovaný)|encrypted (šifrovaný)|sparse (zřídka)|Označení verze|Číslo verze|Typ souboru|bajty|kilobajty|megabajty|gigabajty|Datový soubor|Složka|Bod změny zpracování|Název v systému DOS|Cesta|Složka (atribut)|Offline"
After adding more characters to the translation, the menu items have been shifted by several texts:

Code: Select all

1579="Celý název|Název|Přípona|comment (komentář)|Velikost|creationdate (datum vytvoření)|creationtime (čas vytvoření)|writedate (datum poslední úpravy)|writetime (čas poslední úprav)|accessdate (datum posledního přístupu)|accesstime (čas posledního přístupu)|Atributy číselnou hodnotou|Atributy písmeny|Archivovat|Jen pro čtení|Skrytý|Systémový"
1580="compressed (komprimovaný)|encrypted (šifrovaný)|sparse (zřídka)|Označení verze|Číslo verze|Typ souboru|bajty|kilobajty|megabajty|gigabajty|Datový soubor|Složka|Bod změny zpracování|Název v systému DOS|Cesta|Složka (atribut)|Offline"
See screenshots: https://photos.app.goo.gl/rvjCUnS8nNht6d2s5

Regards,
Petr

User avatar
Dalai
Power Member
Power Member
Posts: 6779
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Shift text menu items when the translated string is long.

Post by *Dalai » 2019-10-16, 14:49 UTC

Which codepage did you specify in this language file? See other existing language files for reference.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups

krapet
Junior Member
Junior Member
Posts: 20
Joined: 2007-08-02, 06:39 UTC
Location: Czech

Re: text menu items are Shift when the translated string is long.

Post by *krapet » 2019-10-16, 16:21 UTC

File:
WCMD_CZ.LNG
starts with:
Čeština (Czech)
codepage=1250


Codepage is not a problem.
I did a similar test (I extended some items) with WCMD_DEU.LNG. The result is the same problem.
But when I compared WCMD_EN.LNG with WCMD_DEU.LNG, I found that 1580 does not begin by translating the word "compressed" (as in 1579) as WCMD_EN.LNG.
So I tried to move some of the text from the end of string 1579 to the beginning of string 1580 in WCMD_EN.LNG. It helped!

Now I see a possible cause of the problem.
If the "|" (pipeline) separator is after position 256, it is not recognized. It can also be a limit of 256 (255) characters for whole string.
If such a restriction exists, an error message should be displayed when it is occur.

Further I don't understand why the '.' (dot character) is not allowed in translation. See screenshot.

User avatar
Dalai
Power Member
Power Member
Posts: 6779
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: text menu items are Shift when the translated string is long.

Post by *Dalai » 2019-10-16, 16:36 UTC

Well, the question about the string length and the dot can probably only be answered by Ghisler.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38408
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: text menu items are Shift when the translated string is long.

Post by *ghisler(Author) » 2019-10-16, 17:10 UTC

Have you tried with the DifRes tool whether it finds any duplicate strings?
Author of Total Commander
http://www.ghisler.com

User avatar
petermad
Power Member
Power Member
Posts: 8974
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: text menu items are Shift when the translated string is long.

Post by *petermad » 2019-10-17, 02:43 UTC

It has been reported before - see: viewtopic.php?p=338403#p338403
License #524 (1994)
Danish Total Commander Translator
TC 9.5b8 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38408
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: text menu items are Shift when the translated string is long.

Post by *ghisler(Author) » 2019-10-17, 08:46 UTC

Ah, I see - yes, there is such a length limit. Since 1580 is so much shorter than 1579, try moving strings from the end of 1579 to the beginning of 1580.
Author of Total Commander
http://www.ghisler.com

Post Reply