Author Topic: A tool to translate wxWidgets projects  (Read 73692 times)

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
A tool to translate wxWidgets projects
« on: August 05, 2013, 11:43:59 pm »
I suggest a plugin script for translating project using Code::Blocks wxWidgets.
This extension of  Code::Blocks will be offered on:
https://sourceforge.net/projects/wxtranslate/
and is called :
Quote
wxTranslate_plugin.script
I will lay the deposit in a few days.

It scans all files (project, or workspace) then creates the file '*.po' we give Poedit.
It uses 'xgettext.exe' and 'wxrc.exe (tools wxWidgets).

If this tool is interest on the forum ,  I will write a wiki page to describe its use.

Sincerely

« Last Edit: August 07, 2013, 04:38:46 pm by LETARTARE »
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: A tools to translate wxWidgets projects
« Reply #1 on: August 06, 2013, 10:37:02 am »
Hello!
it's a squirrel plug-in?

Seems to be useful, also a separate sourceforge page is great, so the plug-in doesn't get lost!

greetings!

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: A tools to translate wxWidgets projects
« Reply #2 on: August 06, 2013, 02:25:16 pm »
+1 for this plugin. Good luck...
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: A tools to translate wxWidgets projects
« Reply #3 on: August 06, 2013, 03:51:13 pm »
Thank you.
Yes, it's a squirrel plugin (78 kb !!) that dialogue with executable.
This is the first time as I use a SVN repository I also gently so as not to make mistakes.
A soon.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: A tools to translate wxWidgets projects
« Reply #4 on: August 07, 2013, 03:48:19 pm »
You can browse the source at :
https://sourceforge.net/projects/wxtranslate/
then get a zip file (or a 7z file).
Version 0.3.1, follow the instructions in the 'infos' (English and French).

Good use.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: A tool to translate wxWidgets projects
« Reply #5 on: August 09, 2013, 10:59:17 am »
You will find some new pictures of the use on the download site.
https://sourceforge.net/projects/wxtranslate/
A soon.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: A tool to translate wxWidgets projects
« Reply #6 on: August 09, 2013, 08:26:50 pm »
Hi.
i tried your script with c::b ;) and got this error, witch seems legit:
Code
The project name 'Code::Blocks wx2.8.x - Unix' contains an illegal character ':'
i think this should not be a error message, but it should replace the illegal character with something like '_' or '-' ....

I'm also running linux, and i have problems with the ".exe" thing.... it is to hard to implement a check wit "PLATFORM" and remove the .exe from execute string.

greetings
« Last Edit: August 09, 2013, 08:33:06 pm by BlueHazzard »

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: A tool to translate wxWidgets projects
« Reply #7 on: August 09, 2013, 09:21:56 pm »
@BlueHazzard
Thank you for trying.

Yes it's normal ':' is an illegal caracter and  '::' also.
Under Wndows, the name of a file must not use certain characters   ( _T("[:*?\"<>|]") ).
You must change the project name with 'Properties' for example :
Quote
Code::Blocks wx2.8.x - Unix -> CodeBlocks_wx2.8.x_Unix

See "function filenameOk(namefile)":L2379.

I made it clear in the documentation that this script is currently working ONLY for Windows.
Obviously the 'exe' can not be considered under Linux.
I have no running Linux and I can not do testing machine.

Sincerely.
« Last Edit: August 09, 2013, 09:24:25 pm by LETARTARE »
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: A tool to translate wxWidgets projects
« Reply #8 on: August 10, 2013, 08:53:06 am »
I fixed an error in 'wxTranslate_plugin.script':L80 :
Code
Rexe = _T("wxrc294.exe") -> 'Rexe = _T("wxrc.exe")'
new version'0.3.2'

I changed the site, but the download is still on the old version 0.3.1 ??
Also you need to make the change by hand, until 'SourceForge' make changes.
thanks
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: A tool to translate wxWidgets projects
« Reply #9 on: August 10, 2013, 10:31:52 pm »
Hello. No time to use it right now (an my current project is not at translation stage - oops), but I've seen the screenshots and quickly downloaded then read in diagonal (big explanation file :o)... It sounds promising ;) Do you plan to enter in the contrib plugins which are installable from the plugin manager ?

Also, I didn't understood a line (and maybe others, but not read sequentially) :
Quote
it is assumed that 'codeblocks.exe' is installed in '$(cb_exe)'
What does it means ? Does $(cb_exe) a variable defined somewhere ?
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: A tool to translate wxWidgets projects
« Reply #10 on: August 11, 2013, 12:33:34 am »
Thank you very much for recovered 'wxTranslateplugin'.

Quote
Do you plan to enter in the contrib plugins which are installable from the plugin manager
For now we must first test to remove all existing errors ...
Then it would make adaptation to Linux and Mac ...

Quote
Does $(cb_exe) a variable defined somewhere
this is a mistake, it lacks '#'
Quote
$(cb_exe) -> $(#cb_exe)
is to indicate the installation path 'codeblocks.exe' in explanations, but it is not necessary to declare this global variable in 'Settings-> Global variables', because it is not used by the script plugin.

The deposit is updated 'wxTranslate-0.3.2'.

Thank you again for pointing me this oversight, but it is probably more.
I remain at your disposal for any explanation.

CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: A tool to translate wxWidgets projects
« Reply #11 on: August 12, 2013, 02:35:45 am »
OK, better understood about the C::B's cb_exe variable. Also, maybe a tiny thing, but the zip I've downloaded was called Translator.zip : why not use a more explicit filename like wxTranslatePluginForCB_vNNN.zip ?

Good night
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: A tool to translate wxWidgets projects
« Reply #12 on: August 12, 2013, 12:18:24 pm »
@eranon
yes it'possible, but actually it is called 'Translator-0.3.2.zip' or *.7z.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: A tool to translate wxWidgets projects
« Reply #13 on: August 12, 2013, 05:23:00 pm »
Yes, I know ;) And it's the reason why of my request... Just because when you have hundreds of GB of piece of software, "Translator" is not very speaking... But it's your plugin of course and I can absolutely rename it locally to be able to retrieve it easily... ;D
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: A tool to translate wxWidgets projects
« Reply #14 on: August 12, 2013, 06:56:49 pm »
@eranon
yes , indeed you are right, I will modify the next release.
Have you tried ?
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl