Translate Program

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Translate Program

Post by El_isra »

i've seen and tested every example that I found on internet, none of them worked...
Could you point me to a good tutorial that explains everything?

Here's the program that i'm trying to add translations support
https://github.com/israpps/HDL-Batch-installer:
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Translate Program

Post by doublemax »

What did you try and what didn't work?

The two sources of information you need, are:
https://docs.wxwidgets.org/trunk/overview_i18n.html

And the "internat" sample that comes with wxWidgets.
Use the source, Luke!
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: Translate Program

Post by El_isra »

doublemax wrote: Sun May 23, 2021 9:21 pm What did you try and what didn't work?

The two sources of information you need, are:
https://docs.wxwidgets.org/trunk/overview_i18n.html

And the "internat" sample that comes with wxWidgets.
i dont know how to get this shit working.

mostly because the frame & app basic code was written by codeblocks wizard
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Translate Program

Post by ONEEYEMAN »

Hi,
As doublemax said, take a look at the international sample.
Build it, run it, see what it does.
Then look at the code.

If you still have questions then - please come back.

Thank you.
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: Translate Program

Post by El_isra »

after taking a look at internat again I tried to implement it into my program.
the frame constructor trows an "üninitialized member reference on 'wxLocale&' "...
any idea?
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: Translate Program

Post by El_isra »

ONEEYEMAN wrote: Tue May 25, 2021 12:07 pm Hi,
As doublemax said, take a look at the international sample.
Build it, run it, see what it does.
Then look at the code.

If you still have questions then - please come back.

Thank you.
could you help me out?
I can upload the translation branch that i've made to test
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: Translate Program

Post by El_isra »

i've managed to build the program (removing the '&' operator on wxlocale declaration at frame class worked,
strings aren't being translated

https://github.com/israpps/HDL-Batch-in ... e/internat
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Translate Program

Post by doublemax »

I compiled your program and the translated texts showed up.
S_210526_182439.png
S_210526_182439.png (14.24 KiB) Viewed 1919 times
Strangely enough, using ProcMon i could see that even in your executable the catalog was loaded correctly.

I have no idea where else it could fail, but i'm sure you're very close to the solution.
Use the source, Luke!
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: Translate Program

Post by El_isra »

doublemax wrote: Wed May 26, 2021 4:28 pm I compiled your program and the translated texts showed up.

S_210526_182439.png

Strangely enough, using ProcMon i could see that even in your executable the catalog was loaded correctly.

I have no idea where else it could fail, but i'm sure you're very close to the solution.
Thanks for taking the time to test it!!!!
I have no clue why this happens...
I've tested executing the program without admin priviledges and got the same result... (The GUI must be executed as admin to properly execute HDL.EXE)

maybe something changed when you compiled the program?
i'm using wxWidgets 3.0.5 with this configuration: https://github.com/israpps/HDL-Batch-in ... /build.cfg
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Translate Program

Post by doublemax »

My configuration was very different, but i don't think that should make any difference in this case.

wxWidgets 3.1.5, built with VS2017, static linking

I had to comment out these two lines, because VS couldn't compile the code in "crude_call.h"

Code: Select all

#include "crude_call.h"

HDL.SystemCapture(command, ".", result, output_err, retcode,false);
But i only tested on German Windows versions (7 and 10).

Try to make a minimal sample that shows the issue on your machine. It should make it much easier to narrow down the problem (and maybe for other people to test it).
Use the source, Luke!
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: Translate Program

Post by El_isra »

doublemax wrote: Wed May 26, 2021 6:52 pm My configuration was very different, but i don't think that should make any difference in this case.

wxWidgets 3.1.5, built with VS2017, static linking

I had to comment out these two lines, because VS couldn't compile the code in "crude_call.h"

Code: Select all

#include "crude_call.h"

HDL.SystemCapture(command, ".", result, output_err, retcode,false);
But i only tested on German Windows versions (7 and 10).

Try to make a minimal sample that shows the issue on your machine. It should make it much easier to narrow down the problem (and maybe for other people to test it).
commenting those lines didn't change anything...

did you download the program from the internat branch?
because that crude_system_call function was taken away from the HDL class a long time ago...
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: Translate Program

Post by El_isra »

doublemax wrote: Wed May 26, 2021 6:52 pm Try to make a minimal sample that shows the issue on your machine. It should make it much easier to narrow down the problem (and maybe for other people to test it).
the internat sample worked well (Compiled with wxwidgets 3.0.5 as monolithic DLL)
i'll try with the wxwidgets template of code::Blocks....
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: Translate Program

Post by El_isra »

someone else tested the program and it isn't showing the Translated strings....
maybe I should try with wxWidgets 3.1.5??
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Translate Program

Post by ONEEYEMAN »

Hi,
I would rather try with the multi-lib build.
MONOLITHIC shuold only be used if you are developing a Code::Blocks itself.

Everybody else should use multilib builds of the wxWidgets.

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Translate Program

Post by doublemax »

El_isra wrote: Wed May 26, 2021 8:00 pm someone else tested the program and it isn't showing the Translated strings....
maybe I should try with wxWidgets 3.1.5??
Might be worth a try.

Here's the binary i created: If you dare to run exes from strangers, please try it out:
https://easyupload.io/ya2yg7
Use the source, Luke!
Post Reply