Page 1 of 1

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

Posted: 2019-10-16, 13:43 UTC
by krapet
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

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

Posted: 2019-10-16, 14:49 UTC
by Dalai
Which codepage did you specify in this language file? See other existing language files for reference.

Regards
Dalai

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

Posted: 2019-10-16, 16:21 UTC
by krapet
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.

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

Posted: 2019-10-16, 16:36 UTC
by Dalai
Well, the question about the string length and the dot can probably only be answered by Ghisler.

Regards
Dalai

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

Posted: 2019-10-16, 17:10 UTC
by ghisler(Author)
Have you tried with the DifRes tool whether it finds any duplicate strings?

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

Posted: 2019-10-17, 02:43 UTC
by petermad

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

Posted: 2019-10-17, 08:46 UTC
by ghisler(Author)
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.