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

Offline LETARTARE

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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 »
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2566
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

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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.
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!

Offline LETARTARE

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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.
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!

Offline LETARTARE

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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.
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2566
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: [Select]
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

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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 »
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!

Offline LETARTARE

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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: [Select]
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
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.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

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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.

C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.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

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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.
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.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

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
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 ?
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!