Author Topic: "Find broken files in project" positioned under menu "Plugins"  (Read 6571 times)

Offline Anbang24

  • Multiple posting newcomer
  • *
  • Posts: 14
"Find broken files in project" positioned under menu "Plugins"
« on: December 25, 2019, 01:38:33 am »
When the language of Code::Blocks is set as English, there are many plugins under main menu "Plugins(L)", shown as (A) in the attached picture.

But when the language is set as Chinese, then most of the plugins are still under main menu "插件(L)” ("Plugins(L)" in English), however, the plugin "Find broken files in project" is not in this menu, but under another separated menu "插件" ("Plugin" in English).  Shown as (B) and (C) in the attached picture.

If we set the language to Russian, then most of the plugins are under the Russian menu "модель", the plugin "Find broken files in project" is under another separated menu "Plugins".  Shown as (D) and (E) in the attached picture.

Please check this problem.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #1 on: December 25, 2019, 05:54:18 am »
Which Code::Blocks version/SVN?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #2 on: December 25, 2019, 06:10:22 am »
Does anyone know is translation magic work on script files like "plugin_find_broken_files.script"?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Anbang24

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #3 on: December 25, 2019, 06:19:55 am »
Which Code::Blocks version/SVN?

Tim S.

Code::Blocks 17.12, build 30 Dec 2017.

It is the latest version from the "Download binary" webpage: http://www.codeblocks.org/downloads/26

Offline Anbang24

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #4 on: December 25, 2019, 06:41:14 am »
Does anyone know is translation magic work on script files like "plugin_find_broken_files.script"?

Tim S.

I opened "plugin_find_broken_files.script" in **\CodeBlocks\share\CodeBlocks\scripts\ , and found that there is such a function:

    // create menubar items
    function GetMenu()
    {
        local entries = ::wxArrayString();
        entries.Add(_("Plugins") + _T("/0:-") + _("Find broken files in project"), 1);
        return entries;
    }

Obviously, here lies the problem: it tries to add a menuentry under the menu named "Plugins".
In order to eliminate the problem, I should make a translation here.

However, this is not a good solution. Because I found another magic:
Open C::B (whatever the version or language), click "Plugins > Manage plugins", select one plugin in "Installed plugins" list, then click "Disable", the menu "plugins" will refresh, and "Find broken files in project" disappeared! (It will return back when restart C::B).

In my opinion, the plugin "Find broken files in project" shouldn't add itself to the menu by a startup script. It should be managed as same as other plugins!


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #5 on: December 25, 2019, 09:07:55 am »
In my opinion, the plugin "Find broken files in project" shouldn't add itself to the menu by a startup script. It should be managed as same as other plugins!

I disagree!

It is the only script "plugin"; it can not be handled like the c++ code plugins.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Anbang24

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #6 on: December 25, 2019, 01:40:19 pm »
I disagree!
It is the only script "plugin"; it can not be handled like the c++ code plugins.

I understand your opinion. However, how could we solve the problem?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #7 on: December 25, 2019, 02:48:39 pm »
I disagree!
It is the only script "plugin"; it can not be handled like the c++ code plugins.

I understand your opinion. However, how could we solve the problem?

I have no idea; you will need to wait for a CB Developer; likely need to be one that understand CB scripting enough to decide how much of the fix needs done in C++ and how much in CB scripting.

I see a clear way to fix the menu name; but, I see no way to fix menu item name.

menu name: "Plugins"
menu item name: "Find broken files in project"

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #8 on: December 25, 2019, 08:07:55 pm »
Apparently, in this script, the line you mention is the only one that may be translated: strings beginning with _(
So, what happen if you simply replace the two _( by two  _T(  Of course, it will not be translated, but it could also work as expected ....
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #9 on: December 25, 2019, 08:15:05 pm »
Apparently, in this script, the line you mention is the only one that may be translated: strings beginning with _(
So, what happen if you simply replace the two _( by two  _T(  Of course, it will not be translated, but it could also work as expected ....

The problem is more likely that line is NOT being translated already.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #10 on: December 26, 2019, 11:21:34 am »
Oups, sorry.
Nevertheless, I have tried a few things in this script. Translation can work.
The problem, may be, comes from the menu "Plugins" :
Here, in the script, it is identified by simply "Plugins". And it's only there, it is identified like that.
In the translation file, I find "&Plugins" (used in 1 xrc file)  or even "P&lugins" (used in 5 files: 4 cpp and 1 xrc). It's not the same string. Which one should be used in the script ? ... needs some more investigations...
Have a nice Christmas  ;)
Gd_on

PS : @Anbang24 : Could you try a nightly ? I I remember well, someone tried to use or work on some of the menu strings without the ampersand character (the &) or morelss independantly of its position. But may be it was not still implemented in official 17.12 version. And of course, this implementation has an effect on translations !!!
« Last Edit: December 26, 2019, 03:37:07 pm by gd_on »
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Anbang24

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #11 on: December 27, 2019, 12:20:07 am »
PS : @Anbang24 : Could you try a nightly ? I remember well, someone tried to use or work on some of the menu strings without the ampersand character (the &) or morelss independantly of its position. But may be it was not still implemented in official 17.12 version. And of course, this implementation has an effect on translations !!!

I downloaded the "15 December 2019 build (11927)" and tried. Yes, it works! The script plugin "Find broken files in project" appears under the translated menu "Plugin". That's OK! The problem solved!

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Re: "Find broken files in project" positioned under menu "Plugins"
« Reply #12 on: December 27, 2019, 12:15:19 pm »
Cool  ;D
I think with C::B version 17.12, it should have been OK if in the script you replace   entries.Add(_("Plugins")... by   entries.Add(_("P&lugins")...
But it's not necessary with nightlies and certainly also in the future new version 20.xx.

gd_on
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).