WCMD_ENG.LNG changes the default icon tooltips

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Slavic
Senior Member
Senior Member
Posts: 295
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

WCMD_ENG.LNG changes the default icon tooltips

Post by *Slavic »

The file like WCMD_ENG.LNG located in the <install_dir>\LANGUAGE allows to modify and add some UI elements. However, it also affects the existing tooltips, which are not mentioned in this file in any way. Let's reproduce this bug using the simple test file (TC x64 9.0RC1, Windows 7 x64), set Configuration -> Options -> Language -> English (WCMD_ENG.LNG)

Code: Select all

English
codepage=437
At glance, this should change nothing because of lack of strings like
ID="Description". However, tooltips of most toobar icons become different, and some of the default names become lost and are replaced with internal identifiers:

Go forward -> cm_GotoNextDir
Switch through tree panel options -> cm_SwitchSeparateTree

It seems that the presence of WCMD_ENG.LNG forces the Commander to take all the tooltip texts from the same source as for main menu, and if the particular toolbar item does not exist among main menu items, the internal identifier is used instead.
Desktop: Windows 11 Pro 23H2, TC 11.50. Mobile: Pixel 5a, Android 14, TC 3.60b4
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Why have you specified codepage 437 in this file?
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

It should be codepage=1252

But the reason why you get tooltops like cm_SwitchSeparateTree is that you don't have a wcmd_eng.inc file - it is from this file that TC gets the tooltip text when you use a wcmd_xxx.lng file. So when you use a wcmd_eng.lng file TC will automatically try to use the corresponding wcmd_eng.inc file.

To Ghisler: Maybe it would be a good idea to use totalcmd.inc for the tooltip texts when there is no language specific .inc file and when the cm_command is not present in the .mnu file (where TC otherwise gets the tooltop text from in case of missing .inc file)
Last edited by petermad on 2016-10-13, 09:50 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

BTW it would be a good idea too to specify parent or base language file in LNG to be able to alter only some lines, so TC could read missing strings from that file and tooltips from corresponding INC file.
Slavic
Senior Member
Senior Member
Posts: 295
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Post by *Slavic »

petermad wrote:It should be codepage=1252
Just tested it with that string, the results are the same. Of course I don't have WCMD_ENG.INC (where I would be able to specify the alternative names). After this substitution, TC uses the names from WCMD_ENG.MNU for tooltips, and if there is no such name, it takes the internal ID as a fallback. But it would be better to use the default English names from TOTALCMD.INC for fallback purpose, if no user-defined *.INC was specified.
Desktop: Windows 11 Pro 23H2, TC 11.50. Mobile: Pixel 5a, Android 14, TC 3.60b4
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

But it would be better to use the default English names from TOTALCMD.INC for fallback purpose, if no user-defined *.INC was specified.
Yes, as I proposed...
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Why would you change the codepage of wcmd_eng.lng? Makes no sense...
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2ghisler(Author)
This has nothing to do with the codepage setting in the .lng file - the reported behaviour also applies when there is no codepage= line in the .lng file
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2petermad
Sorry, I do not understand what you mean. The thread starter tried to use a different codepage.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2ghisler(Author)

The thread user complains that if he use a wcmd_eng.lng file withonly a few translation strings (and gives an example where he happens to use another codepage), then the tooltips for some cm_commands (like cm_SwitchSeparateTree ) used in the button bar are shown as cm_xxx (here cm_SwitchSeparateTree) in stead the description for the command (here "Switch through tree panel options").

This is because he doesn't have a corresponding wcmd_eng.inc file with the command descriptions AND because the command is not existing in his wcmd_eng.mnu file.

So that is why I and MVV suggest to use the descriptions i totalcmd.inc as fallback in such situation.

So the fact that Slavic uses codepage=437 in his wcmd_eng.lng file is not the reason for his problem - he would have the problem even with codepage=1252 or without a codepage statement in his wcmd_eng.lng file - it is the missing wcmd_eng.inc file that is the cause of his problem.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Slavic
Senior Member
Senior Member
Posts: 295
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Post by *Slavic »

petermad, thanks for detailed explanation! Indeed, the string "codepage=" doesn't matter, this bug occurs even without that string, when we have only the "English" line and an empty line after (9 bytes in WCMD_ENG.LNG). Very easy to reproduce and switch between two interfaces on the fly:

Configuration -> Options... -> Language
English
English (WCMD_ENG.LNG)

In fact, I would like to add some items to menu without any change of already existing menu and toolbar items. This means that all other items should have their default names and tooltips, like before. No reason to add the lines with tooltips only because these tooltips are missed in the menu.
Desktop: Windows 11 Pro 23H2, TC 11.50. Mobile: Pixel 5a, Android 14, TC 3.60b4
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, I see - if there is no inc file and the language isn't internal, then TC uses menu items for tooltips. That's why there is a tip for "Go back", which is part of the main menu, but not for "Go forward". I have added code to use the English description if there is none, and also no menu item.

Unfortunately this has also a downside: In languages with no inc files, you will get mixed translated and English tooltips instead of translated and cm_x commands.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Unfortunately this has also a downside: In languages with no inc files, you will get mixed translated and English tooltips
Of course - but that is better than the cm_xxx tooltip. Confirmed fixed (improved) in TC9rc2 :-)

There is still one more option for improvement. Imagine that the user has made an alternative language file for for example Danish and has named it wcmd_mylang_dan.lng, but that he has not made a wcmd_mylang_dan.inc file - then TC could fallback to wcmd_dan.inc (if it is installed) before falling back to totalcmd.inc for the tooltips.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Slavic
Senior Member
Senior Member
Posts: 295
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Post by *Slavic »

Fixed in RC2, thank you!
Desktop: Windows 11 Pro 23H2, TC 11.50. Mobile: Pixel 5a, Android 14, TC 3.60b4
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I think that the user will be clever enough to copy the inc file in that case.
Author of Total Commander
https://www.ghisler.com
Post Reply