Change the language in the button name.

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Ziabrev
Junior Member
Junior Member
Posts: 45
Joined: 2022-05-12, 18:03 UTC

Change the language in the button name.

Post by *Ziabrev »

To change the language in the button name, use the OPENBARMENU command in the user command - em_folder:

Code: Select all

[em_folder]
cmd=OPENBARMENU %COMMANDER_PATH%\DIR.BAR
menu="Create directory"
screen

But this is not convenient to use.
For the button to work properly, you need another command that will show a drop-down menu,
for example: OPENBARPOPUP <filename>.
Or is there another way without third-party utilities?
Spoiler
WCMD_ENG.INI:

Code: Select all

[em_folder]
cmd=OPENBARMENU %COMMANDER_PATH%\DIR.BAR
menu="Create directory"

[em_fold1]
cmd=%comspec% /c md
param=""%O""
menu=With the file name under the cursor
[/spoiler]
[em_fold2]
cmd=%comspec% /v:on /c
param=for %%i in (%S) do set mdd=%%~ti && md ^"%P"!mdd:~6,4!-!mdd:~3,2!-!mdd:~0,2!^
menu="With the date name of the selected objects"
====================================

WCMD_RUS.INI:

Code: Select all

[em_folder]
cmd=OPENBARMENU %COMMANDER_PATH%\DIR.BAR
menu="Создать каталог"

[em_fold1]
cmd=%comspec% /c md
param=""%O""
menu=С именем файла под курсором

[em_fold2]
cmd=%comspec% /v:on /c
param=for %%i in (%S) do set mdd=%%~ti && md ^"%P"!mdd:~6,4!-!mdd:~3,2!-!mdd:~0,2!^
menu="С именем даты выделенных объектов"
==================================

DIR.BAR:

Code: Select all

[Buttonbar]
Buttoncount=3
button1=wcmicons.dll,20
cmd1=cm_MkDir
iconic1=0
button2=wcmicons.dll,20
cmd2=em_fold1
iconic2=1
button3=wcmicons.dll,20
cmd3=em_fold2
iconic3=1
Last edited by Ziabrev on 2024-12-12, 08:03 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Change the language in the button name.

Post by *ghisler(Author) »

With RC2, all you need to do is put the translation in wcmd_language.ini in the same directory as wcmd_language.lng, e.g.
[em_folder]
menu="Translation of create directory"
TC loads the tooltip each time you hover over the button, so when you change language, the new tip will be used automatically.
Author of Total Commander
https://www.ghisler.com
Ziabrev
Junior Member
Junior Member
Posts: 45
Joined: 2022-05-12, 18:03 UTC

Re: Change the language in the button name.

Post by *Ziabrev »

For custom commands I use the following files:
LANGUAGE/WCMD_ENG.INI
LANGUAGE/WCMD_RUS.INI

I need the user download command for the button:

Code: Select all

[em_folder]
cmd=%COMMANDER_PATH%\DIR.BAR
menu="Create directory"
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Change the language in the button name.

Post by *ghisler(Author) »

Put the [em_folder] command in both of them, or put it just in usercmd.ini and just the menu= in the two language files.
Author of Total Commander
https://www.ghisler.com
Ziabrev
Junior Member
Junior Member
Posts: 45
Joined: 2022-05-12, 18:03 UTC

Re: Change the language in the button name.

Post by *Ziabrev »

But the command:

Code: Select all

[em_folder]
cmd=%COMMANDER_PATH%\DIR.BAR
menu="Create directory"
It doesn't work that way.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Change the language in the button name.

Post by *ghisler(Author) »

No, when you put a cmd= value in both usercmd.ini and language specific ini, and the two are different, then the translation will be ignored.
Author of Total Commander
https://www.ghisler.com
Ziabrev
Junior Member
Junior Member
Posts: 45
Joined: 2022-05-12, 18:03 UTC

Re: Change the language in the button name.

Post by *Ziabrev »

Regardless of translation, custom command;

Code: Select all

[em_folder]
cmd=OPENBARMENU %COMMANDER_PATH%\DIR.BAR
menu="Создать каталог"
cannot be performed to operate the button.
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Change the language in the button name.

Post by *sa16 »

2Ziabrev
But this is not convenient to use.
Don't you like that the menu doesn't appear next to the panel button?
Ziabrev
Junior Member
Junior Member
Posts: 45
Joined: 2022-05-12, 18:03 UTC

Re: Change the language in the button name.

Post by *Ziabrev »

2sa16
Yes, that's exactly it.
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Change the language in the button name.

Post by *sa16 »

2Ziabrev
for example: OPENBARPOPUP <filename>
Or, for example, OPENBARMENUP < filename >, same command but with P modifier.
Ziabrev
Junior Member
Junior Member
Posts: 45
Joined: 2022-05-12, 18:03 UTC

Re: Change the language in the button name.

Post by *Ziabrev »

2sa16
For example: any to work
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Change the language in the button name.

Post by *sa16 »

2Ziabrev
You can make a combined button (as a last resort):

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Bars\DIR.BAR

wcmicons.dll,29
Create directory|Создать каталог

1
-1
Or do you need a lot of languages?
Ziabrev
Junior Member
Junior Member
Posts: 45
Joined: 2022-05-12, 18:03 UTC

Re: Change the language in the button name.

Post by *Ziabrev »

2sa16
You can make a combo button (as a last resort):
I'm aware of that divider.
This is for public build
I need many languages
I hope Ghisler hears
Ziabrev
Junior Member
Junior Member
Posts: 45
Joined: 2022-05-12, 18:03 UTC

Re: Change the language in the button name.

Post by *Ziabrev »

Command “OPENBARMENU file_name”:
Load a toolbar from the specified BAR file, opening it as a drop-down menu
when called by a button on the main/vertical toolbar - as a menu of this button,
(in other cases - on top of the main toolbar on the side of the active file panel).


I need it to open as a dropdown menu in case of “OPENBARMENU em_ file_bar”:
[em_ file_bar]
cmd=%COMMANDER_PATH%\Name.bar
menu="Name menu_bar”
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Change the language in the button name.

Post by *petermad »

2Ziabrev
I need many languages
This is supported in TC 11.50rc1: https://ghisler.ch/board/viewtopic.php?p=464993#p464993
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
Post Reply