Author Topic: RFC about pane translation  (Read 2904 times)

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1628
RFC about pane translation
« on: November 23, 2023, 07:20:13 pm »
Translating the pane labels as I did in r13179 works, but has a nasty side effect: When saving the perspective the translated labels are saved, overwriting the original english labels that get lost forever.

In brief, the first time you select a non-english language the labels will get stuck in said language and you will not be able to see them in other language.

I am thinking about reverting r13179, this would leave the AUI panes' labels permanently in english, but at least they will not be in russian as I have them currently with all other texts in spanish.

Ideas? Opinions?

Offline gd_on

  • Lives here!
  • ****
  • Posts: 799
Re: RFC about pane translation
« Reply #1 on: November 23, 2023, 08:07:56 pm »
As you know, these strings are saved in a .conf file, default.conf for me (in items caption=something).
Do you know why has been made this choice ? other strings are translated on the fly, but why not these ones ?
Apparently, they are recreated at the next C::B start, if you delete the default.conf, but this is not a good solution because you loose all other config adjustements !
May be you can recreate those strings, and only them, keeping all other settings, when you change the interface language.
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.5 (tests with 3.3), Msys2 Compilers 14.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2805
Re: RFC about pane translation
« Reply #2 on: November 23, 2023, 08:26:56 pm »
Will keeping different personalities for each language work for you?
That, at least, will write a separate .conf file for each language.

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: RFC about pane translation
« Reply #3 on: November 23, 2023, 08:49:16 pm »
Are you talking about these pieces of XML in the default.conf file?it is possible to move these language-related pieces to the lang/en subfolder; lang/fr; lang/it.
Code
default.conf
lang/
  it.xml
  en.xml
Can we import an XML file into another XML file?

Code
<DATA>                        <str>
                            <![CDATA[layout2|name=ManagementPane;caption=Management;state=2099198;dir=4;layer=1;row=0;pos=0;prop=100000;bestw=200;besth=846;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=MessagesPane;caption=Logs & others;state=2099198;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=1164;besth=150;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=CallStackPane;caption=Call stack;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=150;besth=150;minw=150;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=450;floath=150|name=BreakpointsPane;caption=Breakpoints;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=250;minw=150;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=350;floath=250|name=CPURegistersPane;caption=CPU Registers;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=250;minw=150;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=350;floath=250|name=DisassemblyPane;caption=Disassembly;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=250;minw=150;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=350;floath=250|name=ExamineMemoryPane;caption=Memory;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=450;besth=250;minw=350;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=450;floath=250|name=ThreadsPane;caption=Running threads;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=75;minw=250;minh=75;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=450;floath=75|name=WatchesPane;caption=Watches;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=150;besth=250;minw=150;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=150;floath=250|name=MainPane;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=ScriptConsole;caption=Scripting console;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=253;besth=100;minw=100;minh=100;maxw=-1;maxh=-1;floatx=300;floaty=200;floatw=-1;floath=-1|name=JumpTrackerPane;caption=JumpTracker View;state=2099198;dir=4;layer=1;row=0;pos=0;prop=100000;bestw=300;besth=300;minw=30;minh=40;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=300;floath=400|name=CodeSnippetsPane;caption=CodeSnippets;state=2099199;dir=4;layer=1;row=0;pos=0;prop=100000;bestw=300;besth=400;minw=30;minh=40;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=300;floath=400|name=DefMimeHandler_HTMLViewer;caption=HTML viewer;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=250;minw=150;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=350;floath=250|name=FCallTree;caption=Fortran Call/Called-By tree;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=200;besth=250;minw=150;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=200;floath=250|name=MANViewer;caption=Man/Html pages viewer;state=2099198;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=320;besth=240;minw=240;minh=160;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=320;floath=240|name=HighlightedOccurrences;caption=Highlighted Occurrences;state=2099198;dir=4;layer=1;row=0;pos=0;prop=100000;bestw=150;besth=100;minw=50;minh=50;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=100;floath=150|name=OpenFilesPane;caption=Open files list;state=2099198;dir=4;layer=1;row=0;pos=0;prop=100000;bestw=150;besth=100;minw=50;minh=50;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=100;floath=150|name=TodoListPanev2.0.0;caption=Todo list;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=352;besth=94;minw=252;minh=94;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=352;floath=94|name=Tools;caption=Tool Output;state=2099199;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=300;minw=200;minh=150;maxw=-1;maxh=-1;floatx=200;floaty=150;floatw=400;floath=300|name=MainToolbar;caption=Main Toolbar;state=2108158;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=365;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=CompilerToolbar;caption=Compiler Toolbar;state=2108158;dir=1;layer=10;row=0;pos=365;prop=100000;bestw=325;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=DebuggerToolbar;caption=Debugger Toolbar;state=2108158;dir=1;layer=10;row=0;pos=690;prop=100000;bestw=349;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=CodeCompletionToolbar;caption=Code completion Toolbar;state=2108158;dir=1;layer=10;row=1;pos=0;prop=100000;bestw=946;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=BrowseTrackerToolbar;caption=BrowseTracker Toolbar;state=2108158;dir=1;layer=10;row=1;pos=946;prop=100000;bestw=194;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=DoxyBlocksToolbar;caption=DoxyBlocks Toolbar;state=2108158;dir=1;layer=10;row=2;pos=0;prop=100000;bestw=241;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=FortranProjectToolbar;caption=FortranProject Toolbar;state=2108158;dir=1;layer=10;row=2;pos=241;prop=100000;bestw=93;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=IncrementalSearchToolbar;caption=Incremental search Toolbar;state=2108158;dir=1;layer=10;row=2;pos=334;prop=100000;bestw=388;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=NassiShneidermanPluginToolbar;caption=Nassi-Shneiderman diagram Toolbar;state=2108158;dir=1;layer=10;row=3;pos=0;prop=100000;bestw=513;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=ThreadSearchToolbar;caption=Thread search Toolbar;state=2108158;dir=1;layer=10;row=3;pos=513;prop=100000;bestw=265;besth=32;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|]]>
                        </str>
                    </DATA>
« Last Edit: November 23, 2023, 08:55:03 pm by omlk »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1628
Re: RFC about pane translation
« Reply #4 on: November 25, 2023, 01:57:19 pm »
I have (sort of) fixed this issue restoring the english captions if no translation is active. As described in r13399, to unlock the captions properly the steps are:

1.- If you want to go back to english, disable I18n (in Environment/View), reopen C::B and save the perspective.
2.- If you want to change from one translation to another, switch to english (see 1) and then reenable I18n with the new translation.

Thanks to those who commented.