Internationalization under Windows...
-
Topic authorVincent
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Well, I would rather say : Under Windows, this is precisely what gettext should do...
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
Since I'm a bit tired of waiting for a Windows developer to tackle this issue I've started working on it.
The hardest part was actually getting celestia to compile under Windows (it's such an ugly mess, it even made me regret the autotools).
Anyway, Vincent I'm a bit surprised that you got your patch to compile, it doesn't for me. Here is what I did:
1 - Installed gettext, see here. Installed in c:\Program Files\GnuWin32
2 - Added the include/lib/path to celvars.bat:
3 - Applied your patch with a few fixes:
in src/celestia/celestia.mak replaced intl.lib by libintl.lib in LINK32_FLAGS
in src/celutil/util.h kept the ifdef block:
Now it builds. I have no idea if it runs or not since I'm doing this through RDC on a computer at work. I'll check it tomorrow.
The hardest part was actually getting celestia to compile under Windows (it's such an ugly mess, it even made me regret the autotools).
Anyway, Vincent I'm a bit surprised that you got your patch to compile, it doesn't for me. Here is what I did:
1 - Installed gettext, see here. Installed in c:\Program Files\GnuWin32
2 - Added the include/lib/path to celvars.bat:
Code: Select all
@echo off
Set INCLUDE=C:\Program Files\GnuWin32\include;%INCLUDE%
Set PATH=C:\Program Files\GnuWin32\bin;%PATH%
Set LIB=C:\Program Files\GnuWin32\lib;%LIB%
Set PATH=C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;%PATH%
Set INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;%INCLUDE%
Set LIB=C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;%LIB%
Set INCLUDE=C:\Program Files\Microsoft Platform SDK\include;%INCLUDE%
Set INCLUDE=C:\Program Files\Microsoft Platform SDK\include\mfc;%INCLUDE%
Set LIB=C:\Program Files\Microsoft Platform SDK\Lib\IA64\mfc;%LIB%;C:\Program Files\Microsoft Platform SDK\Lib
3 - Applied your patch with a few fixes:
in src/celestia/celestia.mak replaced intl.lib by libintl.lib in LINK32_FLAGS
in src/celutil/util.h kept the ifdef block:
Code: Select all
#ifdef _WIN32
#include "libintl.h"
#define _(s) gettext(s)
#else
#define _(s) gettext(s)
#endif
Now it builds. I have no idea if it runs or not since I'm doing this through RDC on a computer at work. I'll check it tomorrow.
Christophe
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
Isn't it beautiful?
I had to rename the overlay::printf method, since intl.h has the very bad idea of define'ing printf as libintl_printf.
There is still quite a bit of work to be done:
- Automate language selection
- tweak the makefile to build and install the catalog files
- fix the Win32 GUI code to understand UTF-8
- include translated ressource files to provide translated menus and dialogs.
But we're definitely on the right tracks.
I had to rename the overlay::printf method, since intl.h has the very bad idea of define'ing printf as libintl_printf.
There is still quite a bit of work to be done:
- Automate language selection
- tweak the makefile to build and install the catalog files
- fix the Win32 GUI code to understand UTF-8
- include translated ressource files to provide translated menus and dialogs.
But we're definitely on the right tracks.
Christophe
-
Topic authorVincent
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Christophe,
Thanks a lot for taking the time to dive into the "Windows jungle"
Here are a few questions :
- Where and how did you rename the Overlay::printf method ? I made some changes in overlay.cpp but I get an error while compiling.
- Where did you put the fr.gmo file ?
Thanks again.
Thanks a lot for taking the time to dive into the "Windows jungle"
Here are a few questions :
- Where and how did you rename the Overlay::printf method ? I made some changes in overlay.cpp but I get an error while compiling.
- Where did you put the fr.gmo file ?
Thanks again.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
In overlay.cpp I replaced overlay::printf by overlay::oprintf.
I also made the change in overlay.h and celestiacore.cpp (replace all occurrences of overlay.printf by overlay.oprintf).
In winmain.cpp I also changed the path in bintextdomain:
And finaly, I put celestia.mo in C:/Program Files/GnuWin32/share/locale/fr/LC_MESSAGES/. (this will eventualy be moved to a subfolder of the celestia installation.)
I also made the change in overlay.h and celestiacore.cpp (replace all occurrences of overlay.printf by overlay.oprintf).
In winmain.cpp I also changed the path in bintextdomain:
Code: Select all
bindtextdomain("celestia","C:/Program Files/GnuWin32/share/locale");
And finaly, I put celestia.mo in C:/Program Files/GnuWin32/share/locale/fr/LC_MESSAGES/. (this will eventualy be moved to a subfolder of the celestia installation.)
Christophe
-
Topic authorVincent
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Christophe,
I made all the changes you suggested, and the compilation went fine.
Then, I pasted the libiconv2.dll and the libintl3.dll files in the Celestia root folder since Celestia asked for them.
Then, I set the LANG option and ran Celestia from the command window :
But I still can't see the translated strings.
In your last post, you were refering to the intl.h file. I can't find it in GnuWin32. I have the libintl.h file instead that I pasted in the ...\inc folder.
I made all the changes you suggested, and the compilation went fine.
Then, I pasted the libiconv2.dll and the libintl3.dll files in the Celestia root folder since Celestia asked for them.
Then, I set the LANG option and ran Celestia from the command window :
Code: Select all
set LANG=fr_FR
.\celestia.exe
But I still can't see the translated strings.
In your last post, you were refering to the intl.h file. I can't find it in GnuWin32. I have the libintl.h file instead that I pasted in the ...\inc folder.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
Yes, you're right, it's libintl.h, not intl.h. You don't need to copy it to inc if you set INCLUDE as I suggested above.
You do need to copy the two dll.
The interesting thing, is that I can't seem to get it to use anything else but French, whatever the value of LC_ALL or LANG. This is on a French version of Windows.
You do need to copy the two dll.
The interesting thing, is that I can't seem to get it to use anything else but French, whatever the value of LC_ALL or LANG. This is on a French version of Windows.
Christophe
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
Ok, I get it now. The documentation is apparently outdated.
Launching Celestia in the default environment causes it to use the system locale setting (this is good, one thing less to do).
To use another language, you need to set the LANGUAGE environment variable, for example:
Launching Celestia in the default environment causes it to use the system locale setting (this is good, one thing less to do).
To use another language, you need to set the LANGUAGE environment variable, for example:
Code: Select all
Set LANGUAGE=es
celestia.exe
Christophe
-
Topic authorVincent
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Christophe,
I can't figure out why it's still not working on my system. Not only is the documentation outdated, but it seems to be wrong too : the GnuWin32 FAQ says that the linker has to find the intl.lib file. But you used the libintl.lib file instead...
I can't figure out why it's still not working on my system. Not only is the documentation outdated, but it seems to be wrong too : the GnuWin32 FAQ says that the linker has to find the intl.lib file. But you used the libintl.lib file instead...
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorVincent
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
OK, it's working now !
The problem didn't come from the code, but from the celestia.mo file. After converting the .po file with Msgfmt, I got a celestia.gmo file instead of the celestia.mo file... I still don't know why... I copied your celestia.mo file in my system and everything went fine.
Now, I'm going to test your binary on a default 1.4.1 package, with the locale folder included in the Celestia root folder.
Thanks Christophe.
The problem didn't come from the code, but from the celestia.mo file. After converting the .po file with Msgfmt, I got a celestia.gmo file instead of the celestia.mo file... I still don't know why... I copied your celestia.mo file in my system and everything went fine.
Now, I'm going to test your binary on a default 1.4.1 package, with the locale folder included in the Celestia root folder.
Thanks Christophe.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
celestia.mo is the compiled form of your catalog file (.po file).
Follow the instructions on http://celestia.teyssier.org/download/win32/
Follow the instructions on http://celestia.teyssier.org/download/win32/
Christophe
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
I am also getting impatient. Since years I am compiling the CVS Windows executable in parallel to Linux, to make sure that things remain compatible. Since Chris' last I18N commit (including the new winlibs), my VS+-2003 environment goes crazy, stating that intllib.h and other includes cannot be found anymore (despite correct paths) ...
I didn't have the time yet to dig myself through this mess...
I strongly urge better testing of Windows commits in the furture!
It costs a lot of time to mess around with such sloppy /half working stuff.
Bye Fridger
I didn't have the time yet to dig myself through this mess...
I strongly urge better testing of Windows commits in the furture!
It costs a lot of time to mess around with such sloppy /half working stuff.
Bye Fridger
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
Fridger, maybe that would have helped if people had actually tested the patch and reported any problem.
I know you're not interested in i18n, but if you'd taken the time of a simple compilation test then you'd have saved yourself spending time on it now. It's not as if I'd dropped the thing on CVS without any notice.
I have access to only one (ancient) Windows box, without VS, I used the VC++ Toolkit and SDK and it worked fine there. I'm sorry to hear MS development tools are inconsistent.
I know you're not interested in i18n, but if you'd taken the time of a simple compilation test then you'd have saved yourself spending time on it now. It's not as if I'd dropped the thing on CVS without any notice.
I have access to only one (ancient) Windows box, without VS, I used the VC++ Toolkit and SDK and it worked fine there. I'm sorry to hear MS development tools are inconsistent.
Christophe
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
Christophe wrote:Fridger, maybe that would have helped if people had actually tested the patch and reported any problem.
I know you're not interested in i18n, but if you'd taken the time of a simple compilation test then you'd have saved yourself spending time on it now. It's not as if I'd dropped the thing on CVS without any notice.
I have access to only one (ancient) Windows box, without VS, I used the VC++ Toolkit and SDK and it worked fine there. I'm sorry to hear MS development tools are inconsistent.
Christophe,
my above remark was not to your address, but rather to the one of Chris. It's that sort of thing, for example:
Selden wrote:Chris wrote
> Christophe's i18n work for Windows adds a dependency on the a new library.
> I've added libintl.h to winlibs and uploaded a new version:
> http://www.celestiaproject.net/celestia/files/winlibs-new.zip
Well, maybe you intended to do so, but it's still the old version,
dated 24-Aug-2004
...and so on...That was 2 1/2 half days ago, already.
After all, Chris is taking responsability for the Windows part.
Indeed, I am not at all interested in I18N, but I do have a vivid interest to test my core code versus Windows regularly and without unnecessary loss of time!
Bye Fridger
-
- Developer
- Posts: 944
- Joined: 18.07.2002
- With us: 22 years 4 months
- Location: Lyon (France)
I understand Fridger.
What I'm getting really frustrated with is the apparent total lack of windows dev interest in the project.
The windows user base is what? something like 20 times that of the other platforms? and we have a grand total of one active developer (Chris nonetheless), if ratios of users held we should have something like a hundred! a real army. I really don't get this, are windows developers generaly incompetent? a bunch of freeloaders?
I know some developers release their own patched version of Celestia, why do they keep to themselves and don't get more involved in the project as a whole?
What I'm getting really frustrated with is the apparent total lack of windows dev interest in the project.
The windows user base is what? something like 20 times that of the other platforms? and we have a grand total of one active developer (Chris nonetheless), if ratios of users held we should have something like a hundred! a real army. I really don't get this, are windows developers generaly incompetent? a bunch of freeloaders?
I know some developers release their own patched version of Celestia, why do they keep to themselves and don't get more involved in the project as a whole?
Christophe
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
Christophe wrote:I understand Fridger.
What I'm getting really frustrated with is the apparent total lack of windows dev interest in the project.
The windows user base is what? something like 20 times that of the other platforms? and we have a grand total of one active developer (Chris nonetheless), if ratios of users held we should have something like a hundred! a real army. I really don't get this, are windows developers generaly incompetent? a bunch of freeloaders?
Obviously Windows users are fluently speaking English ...
So does Bill Gates.
I know some developers release their own patched version of Celestia, why do they keep to themselves and don't get more involved in the project as a whole?
Yes, fine, but honestly I wouldn't be all that happy to see these patches in the official version...There are many things I would have to say here...
Bye Fridger