How to add my own menu (in english)

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
TvE
Junior Member
Junior Member
Posts: 12
Joined: 2022-03-17, 22:53 UTC
Location: Denmark

How to add my own menu (in english)

Post by *TvE »

I would like to add my own menu, eg like this:

Code: Select all

Files | Mark  ... Start | Help

Code: Select all

Files | Mark  ... Start | MyMenu | Help
                          ^^^^^^
I have googled, read TC wiki and a lot more, but failed to find a simple ELI5 answer - so clearly I must have missed the obvious ;-)


* I see that c:\Program Files\totalcmd\LANGUAGE\WCMD_ENG.MNU is an english menu
** Though I was expeting this con to reside in c:\Users\<%USER%>\AppData\Roaming\GHISLER
* I have copied+modified a single section form there and given it a new name POPUP "&MyMenu" ... END_POPUP (to start with a known good syntax)
* Saved it in the same folder as file WCMD_ENG.MNU
* Re-launched TC

Expecting it to be loaded (like an *.inc file in the apache configuration)

But clearly something else is needed...!

I do see that all other that the ENG language is made up of *.INC, *.LNG & *.MNU files, (the english versions are liely embeded ion TCM itself, hence not as seperate files

I also see that I can point to a seperate language file in Conf -> Options -> Languague
BUT I just want to add to the existing menu structure (add my MyMenu main menu item)

I also see that I can install petermad's extensive menues (https://madsenworld.dk/index-uk.htm?wincmd/index-uk.htm)
but in stead of trying to reverse engineer that installation process I'd rather get a quick simple guide :)
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to add my own menu (in english)

Post by *beb »

2TvE
I do my custom menu this way:
I make my own language and menu files, let's say:
%commander_path%\Language\WCMD_BEB_ENG.LNG
%commander_path%\Language\WCMD_BEB_ENG.MNU

WCMD_BEB_ENG.LNG file has nothing inside, but (my preferred entries, if any; otherwise it can be empty at all except a caption string*):

Code: Select all

English by user (me)
codepage=65001
677="<dir>"
678="<lnk>"
1449="TB"
1450="b"
1451="kB"
1452="MB"
1453="GB"
* In the case of a language other than English .LNG file has to contain all the language entries, hence such a case becomes more complicated upon updates.

In case of .MNU file, it has to have a full menu inside. Nothing would be taken from anywhere else when absent, even in the case of English.
My WCMD_BEB_ENG.MNU has a structure as follows (* Note: only root entries are listed):

Code: Select all

POPUP "&Files"
POPUP "&Mark"
POPUP "&Commands"
POPUP "&Net"
POPUP "Sho&w"
POPUP "C&onfiguration"
; * CUSTOM MENU START
POPUP "Custom"
POPUP "Total"
POPUP "Commander"
; * CUSTOM MENU END
HELP_BREAK
POPUP "&Help"
STARTMENU
Where, everything is vanilla except those in between ";* CUSTOM MENU START" and "; * CUSTOM MENU END".
In its turn, those custom menu segment features all the custom commands and vanilla commands that are being used most frequently (by me).

Then I just go to "Configuration - Option - Language" and opt there for my own "English by user (me)" entry. And that's it.

I don't touch any other files at all (.INC, etc).

It just works like a charm.

It cannot be overwritten by any vanilla updates.

It can be relatively easily updated by hand if the vanilla menu gets radical updates.
When the new Total Commander version is being rolled out, I take the vanilla .MNU, make a copy of it as WCMD_BEB_ENG.MNU, copy-paste there my custom part (; * CUSTOM MENU START ... ; * CUSTOM MENU END), opt for my own "English by user (me)" language entry. And that's it again. And so on.

Recently, I posted here several videos to illustrate how to do one thing or another, upon users' requests, so it can be seen how it looks and works.
For instance, today's ones:
https://i.imgur.com/v9Ou238.mp4
https://i.imgur.com/SXYuSfD.mp4

Of course, there are some guru-users over here, much more advanced than me, who can give you more advanced advice, but I just share my own approach.

Edit. .LNG and .MNU files naming changed regarding petermad's remark.
petermad wrote: 2024-12-20, 12:19 UTC ...WCMD_BEB_ENG.LNG and WCMD_BEB_ENG.MNU...
Last edited by beb on 2024-12-20, 14:40 UTC, edited 3 times in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
User avatar
solid
Power Member
Power Member
Posts: 749
Joined: 2004-08-09, 11:20 UTC

Re: How to add my own menu (in english)

Post by *solid »

Is WCMD_ENG.MNU selected as the "main menu file" in the language section in the settings?
AFAIR for English menu TC by default use built in menu file that cannot be changed. It must be manually changed to external menu file that can be edited.
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to add my own menu (in english)

Post by *beb »

2solid
You can modify WCMD_ENG.MNU the way you want.
The case is, that it will be overwritten upon updates without a notice, and you will lose all the customization.
So, it's a good idea, to make a copy of WCMD_ENG.MNU alike WCMD_CUSTOM_ENG.MNU and work with it (having a parallel WCMD_CUSTOM_ENG.LNG as described in my previous message)...

Edit. .LNG and .MNU files naming changed regarding petermad's remark.
petermad wrote: 2024-12-20, 12:19 UTC ...WCMD_BEB_ENG.LNG and WCMD_BEB_ENG.MNU...
Last edited by beb on 2024-12-20, 14:41 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to add my own menu (in english)

Post by *petermad »

2TvE
https://ghisler.ch/board/viewtopic.php?p=397709#p397709


2beb
I make my own language and menu files, let's say:
%commander_path%\Language\WCMD_BEB.LNG
%commander_path%\Language\WCMD_BEB.MNU
You should name your files:
%commander_path%\Language\WCMD_BEB_UKR.LNG
%commander_path%\Language\WCMD_BEB_UKR.MNU

If you have your language code right before the Extension, TC will use Ukranian language in plugins, if available.
And if you have:
%commander_path%\Language\WCMD_UKR.CHM the ukranian Help file will automatically be used if you use WCMD_BEB_UKR.LNG
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
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to add my own menu (in english)

Post by *beb »

2petermad
Yes, I do it for Ukrainian.
However, I don't do it for English.
What is the best practice here?
To name it WCMD_BEB_ENG.LNG,WCMD_BEB_ENG.MNU, too?
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to add my own menu (in english)

Post by *petermad »

What is the best practice here?
To name it WCMD_BEB_ENG.LNG,WCMD_BEB_ENG.MNU, too?
Yes, if you have modified the original WCMD_ENG.LNG and WCMD_ENG.MNU files, then you should name them WCMD_BEB_ENG.LNG and WCMD_BEB_ENG.MNU.

What is shown in TC's language configuration dialog is the text in the first line of 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
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to add my own menu (in english)

Post by *beb »

2petermad
Thank you.
I will edit my messages here then.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to add my own menu (in english)

Post by *petermad »

Here are some old threads that migh be of interest regarding the language/menu system in TC:
https://ghisler.ch/board/viewtopic.php?p=171612#p171612
https://ghisler.ch/board/viewtopic.php?p=403136#p403136
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
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to add my own menu (in english)

Post by *beb »

2TvE
Eventually, this is how your desired menu layout is being achieved.
WCMD_TvE_ENG.LNG

Code: Select all

English by TvE
codepage=65001
The custom language file is just effectively empty (the language entries would be taken from an internal source), it features a caption (to be visible as such in the settings), and a codepage declaration.

WCMD_TvE_ENG.MNU

Code: Select all

POPUP "&Files"
END_POPUP
POPUP "&Mark"
END_POPUP
POPUP "&Commands"
END_POPUP
POPUP "&Net"
END_POPUP
POPUP "Sho&w"
END_POPUP
POPUP "C&onfiguration"
  MENUITEM "&Options...",cm_config
END_POPUP
STARTMENU
POPUP "^^^MyMenu (left to help-break)^^^"
END_POPUP
HELP_BREAK
POPUP "^^^MyMenu (right to help-break)^^^"
END_POPUP
POPUP "&Help"
END_POPUP
The custom menu file has to feature all the necessary entries.
I put it here in a contracted form, that includes only title items and gives an understanding of how things work here.
Please, note the HELP_BREAK main menu entry, which has a self-explanatory nature:
I placed two custom menu entries "^^^MyMenu (left to help-break)^^^" and "^^^MyMenu (right to help-break)^^^" to visualize its effect.

Now you go to options and switch to your custom language there, and that's it.

Video illustration:
Image: https://i.imgur.com/Omexe3I.mp4
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
TvE
Junior Member
Junior Member
Posts: 12
Joined: 2022-03-17, 22:53 UTC
Location: Denmark

Re: How to add my own menu (in english)

Post by *TvE »

Excellent advise 2petermad & 2beb

I now have my own menu.
NB.: I did have a strange behavior getting my edited files to be presented in the "change the languague" list. I ended up copying known good files and re-edited them to my need. (I must have done something wrong that annoyed TC...)

So the only downside is that I need to diff the menu against the new version every time an update has taken place to ensure I am not missing out on any changes from future updates.

It would be nice if there was a mechanism that allowed to *append* to the existing menu to avoid the above mention (albeit very small!) downside of the curret structure. Presumably this thread (https://ghisler.ch/board/viewtopic.php?p=171612#p171612) is a similair wish ;-)

TIP: Remember to read this note
* Note: only root entries are listed
A FULL menu file is needed, the example is just the "headers" (that fooled me for some time :?

Next step: Collect all my changes and put them in a DOTFILES'like repo to make it ewasy to replicate on other PC's (like my use of YADM on my linux machines).
Feel free to share any hints regarding this - Windows is a different beast, lot's of tha apps I have looked at requires the USERNAME hardcoded in the conf files, thus requiring some kind of pre-processing (why could'nt they just support the %USERNAME%, %USERPROFILE% etc variables...
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to add my own menu (in english)

Post by *petermad »

So the only downside is that I need to diff the menu against the new version every time an update has taken place to ensure I am not missing out on any changes from future updates.
TC's main menu is very rarely changed -but you are right that your need to check wcmd_eng.mnu before your install a new version.
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
larry99
Junior Member
Junior Member
Posts: 62
Joined: 2009-01-16, 16:03 UTC
Location: Germany

Re: How to add my own menu (in english)

Post by *larry99 »

Certainly not high priority but it would be nice to have an include statement similar to INI files.
Then you only have to add a single line like "INCLUDE MyMenu.MNU" to new versions of standard files.
Post Reply