Page 1 of 2

Change the language in the button name.

Posted: 2024-12-12, 07:37 UTC
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

Re: Change the language in the button name.

Posted: 2024-12-12, 08:02 UTC
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.

Re: Change the language in the button name.

Posted: 2024-12-12, 08:16 UTC
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"

Re: Change the language in the button name.

Posted: 2024-12-12, 08:24 UTC
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.

Re: Change the language in the button name.

Posted: 2024-12-12, 08:30 UTC
by Ziabrev
But the command:

Code: Select all

[em_folder]
cmd=%COMMANDER_PATH%\DIR.BAR
menu="Create directory"
It doesn't work that way.

Re: Change the language in the button name.

Posted: 2024-12-12, 10:24 UTC
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.

Re: Change the language in the button name.

Posted: 2024-12-12, 10:36 UTC
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.

Re: Change the language in the button name.

Posted: 2024-12-12, 12:36 UTC
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?

Re: Change the language in the button name.

Posted: 2024-12-12, 12:51 UTC
by Ziabrev
2sa16
Yes, that's exactly it.

Re: Change the language in the button name.

Posted: 2024-12-12, 13:46 UTC
by sa16
2Ziabrev
for example: OPENBARPOPUP <filename>
Or, for example, OPENBARMENUP < filename >, same command but with P modifier.

Re: Change the language in the button name.

Posted: 2024-12-12, 14:22 UTC
by Ziabrev
2sa16
For example: any to work

Re: Change the language in the button name.

Posted: 2024-12-13, 10:17 UTC
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?

Re: Change the language in the button name.

Posted: 2024-12-13, 11:16 UTC
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

Re: Change the language in the button name.

Posted: 2024-12-19, 07:40 UTC
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”

Re: Change the language in the button name.

Posted: 2024-12-20, 04:00 UTC
by petermad
2Ziabrev
I need many languages
This is supported in TC 11.50rc1: https://ghisler.ch/board/viewtopic.php?p=464993#p464993