Re: The LANG environment variable...
On Wed, Jun 15, 2005 at 12:53:07PM +0200, Lars Gullik Bjnnes wrote: en_US is english in the us nn_NO nynorsk in norway no_NO norsk aka bokml in norway. no_NY just seems wrong. Norsk in New York perhaps? Andre'
Re: The LANG environment variable...
On Tue, Jun 14, 2005 at 10:08:09PM +0100, Angus Leeming wrote: On Tuesday 14 June 2005 21:34, Andre Poenitz wrote: On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: if %LANG%== SET LANG=no_NO lyx.exe %* [...] Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) I don't think it works on older Windows versions. I've seen %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume that it can't be a mere oversight of lazy programmers... In that case, shouldn't it be lyx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 I don't really know. I've read the quoting rules for cmd.exe and the only thing that I remember is that there is a possibility to 'overquote'... Andre'
Re: The LANG environment variable...
On Wed, Jun 15, 2005 at 12:53:07PM +0200, Lars Gullik Bjønnes wrote: > en_US is english in the us > nn_NO "nynorsk" in norway > no_NO "norsk" aka bokmål in norway. > > no_NY just seems wrong. Norsk in New York perhaps? Andre'
Re: The LANG environment variable...
On Tue, Jun 14, 2005 at 10:08:09PM +0100, Angus Leeming wrote: > On Tuesday 14 June 2005 21:34, Andre Poenitz wrote: > > On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: > > > if "%LANG%"=="" SET LANG=no_NO > > > lyx.exe %* > > > [...] > > > Second line starts the lyx executable and passes any parameters > > > to it. The script is tested on windows XP. (I don't have lyx for > > > windows, but the LANG test and parameter passing works fine.) > > > > I don't think it works on older Windows versions. I've seen > > %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume > > that it can't be a mere oversight of lazy programmers... > > In that case, shouldn't it be > > lyx.exe "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" I don't really know. I've read the quoting rules for cmd.exe and the only thing that I remember is that there is a possibility to 'overquote'... Andre'
Re: The LANG environment variable...
Angus Leeming wrote: On Tuesday 14 June 2005 21:34, Andre Poenitz wrote: On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: if %LANG%== SET LANG=no_NO lyx.exe %* [...] Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) I don't think it works on older Windows versions. I've seen %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume that it can't be a mere oversight of lazy programmers... I tested with windows98 - windows98 don't support .cmd files (they have to end in .bat instead), and there is no support for %* So it depends on how old windows versions you want to support. Of course %1 %2 %3 ... works on newer windows too, but limits you to 9 arguments. (You can probably get more by using some ugly tricks with the shift command...) In that case, shouldn't it be lyx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 No, that will turn lyx.bat file with spaces.lyx into lyx.exe file with spaces.lyx and that won't work too well. The windows shell is like most other ms software - not well planned for corner cases. If you pass a filename with quotes to a windows batchfile, then the quotes are preserved as part of the %1 variable. Any subsequent use of %1 will retain the quotes. So they shouldn't be necessary, at least not on windows98. Helge Hafting
Re: The LANG environment variable...
Andre Poenitz wrote: On Tue, Jun 14, 2005 at 10:45:07AM +0200, Asger Alstrup wrote: Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer but rather would get the configure script to output \ui_language de_DE to lyxrc.defaults. Thoughts? Looks good to me. I was thinking the same, except that I was leaning towards a command-line option, but lyxrc will do for me as well. The command line option is 'LANG=de_DE lyx' in a decent shell. That'll be 'set LANG=de_DE' in the windows shell. Helge Hafting
Re: The LANG environment variable...
Helge Hafting wrote: Angus Leeming wrote: On Tuesday 14 June 2005 21:34, Andre Poenitz wrote: On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: if %LANG%== SET LANG=no_NO lyx.exe %* [...] Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) I don't think it works on older Windows versions. I've seen %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume that it can't be a mere oversight of lazy programmers... I tested with windows98 - windows98 don't support .cmd files (they have to end in .bat instead), and there is no support for %* So it depends on how old windows versions you want to support. Of course %1 %2 %3 ... works on newer windows too, but limits you to 9 arguments. (You can probably get more by using some ugly tricks with the shift command...) In that case, shouldn't it be lyx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 No, that will turn lyx.bat file with spaces.lyx into lyx.exe file with spaces.lyx and that won't work too well. The windows shell is like most other ms software - not well planned for corner cases. If you pass a filename with quotes to a windows batchfile, then the quotes are preserved as part of the %1 variable. Any subsequent use of %1 will retain the quotes. So they shouldn't be necessary, at least not on windows98. Helge Hafting Hi, Helge. Thanks for the info. I've been testing things out and have two remaining problems: 1. Creating short cuts from the desktop and from the start menu to c:\Program Files\LyX\bin\lyx.bat works perfectly well, but my icons are replaced with that of a .bat file. Any idea how to get back to the icon embedded in lyx.exe? 2 Launching LyX at the end of the installer as !define PRODUCT_BAT $INSTDIR\bin\lyx.bat !define MUI_FINISHPAGE_RUN ${PRODUCT_BAT} works perfectly well, but I get a bloody great cmd window in the background. How do I make it go away? :-) Angus
Re: The LANG environment variable...
Angus Leeming wrote: I've been testing things out and have two remaining problems: 1. Creating short cuts from the desktop and from the start menu to c:\Program Files\LyX\bin\lyx.bat works perfectly well, but my icons are replaced with that of a .bat file. Any idea how to get back to the icon embedded in lyx.exe? Resolved. Read the documentation, Angus! 2 Launching LyX at the end of the installer as !define PRODUCT_BAT $INSTDIR\bin\lyx.bat !define MUI_FINISHPAGE_RUN ${PRODUCT_BAT} works perfectly well, but I get a bloody great cmd window in the background. How do I make it go away? :-) Still to resolve. Angus
Re: The LANG environment variable...
Angus Leeming wrote: Putting the two dataabses together: nn_NO Nynorsk It is no_NY. I put some code tables on http://fkurth.de/uwest/LyX/Installer/LangCodes/ regards Uwe
Re: The LANG environment variable...
Uwe Sthr wrote: nn_NO Nynorsk It is no_NY. Both appear to be quite common. google on nn_NO and on no_NY. Note that the po file is nn.po... Angus
Re: The LANG environment variable...
Angus Leeming [EMAIL PROTECTED] writes: | Uwe Stöhr wrote: nn_NO Nynorsk It is no_NY. | Both appear to be quite common. google on nn_NO and on no_NY. Note | that the po file is nn.po... I think it really should be nn. nn is the language XX is the country. en_EN is english in england en_US is english in the us nn_NO nynorsk in norway no_NO norsk aka bokmål in norway. no_NY just seems wrong. -- Lgb
Re: The LANG environment variable...
Helge Hafting [EMAIL PROTECTED] writes: Angus Leeming wrote: [snip] In that case, shouldn't it be lyx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 No, that will turn lyx.bat file with spaces.lyx into lyx.exe file with spaces.lyx and that won't work too well. To avoid double quoting the ~ character should be used. So: lyx.exe %~1 %~2 %~3 %~4 %~5 %~6 %~7 %~8 %~9 works as expected. Enrico
Re: The LANG environment variable...
Angus Leeming [EMAIL PROTECTED] writes: 2 Launching LyX at the end of the installer as !define PRODUCT_BAT $INSTDIR\bin\lyx.bat !define MUI_FINISHPAGE_RUN ${PRODUCT_BAT} works perfectly well, but I get a bloody great cmd window in the background. How do I make it go away? Still to resolve. Angus Launching the last command in the bat file with start should do the trick. $ cat lyx.bat @echo off rem rem some stuff here rem start lyx.exe Enrico
Re: The LANG environment variable...
Enrico Forestieri wrote: Angus Leeming [EMAIL PROTECTED] writes: 2 Launching LyX at the end of the installer as !define PRODUCT_BAT $INSTDIR\bin\lyx.bat !define MUI_FINISHPAGE_RUN ${PRODUCT_BAT} works perfectly well, but I get a bloody great cmd window in the background. How do I make it go away? Still to resolve. Angus Launching the last command in the bat file with start should do the trick. $ cat lyx.bat @echo off rem rem some stuff here rem start lyx.exe Enrico I'm afraid that doesn't work. But anyway, I went a different route: !define MUI_FINISHPAGE_RUN !define MUI_FINISHPAGE_TEXT $(FinishPageMessage) !define MUI_FINISHPAGE_RUN_TEXT $(FinishPageRun) !define MUI_FINISHPAGE_RUN_FUNCTION LaunchProduct !insertmacro MUI_PAGE_FINISH Function LaunchProduct lyx_configure::set_env LANG $LangCode Exec ${PRODUCT_EXE} FunctionEnd where lyx_configure is a .dll containing (among other things): // Set an environment variable extern C void __declspec(dllexport) set_env(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { EXDLL_INIT(); std::string const var_name = pop_from_stack(); std::string const var_value = pop_from_stack(); SetEnvironmentVariableA(var_name.c_str(), var_value.c_str()); pushstring(0); } Angus
Re: The LANG environment variable...
Enrico Forestieri wrote: Helge Hafting [EMAIL PROTECTED] writes: To avoid double quoting the ~ character should be used. So: lyx.exe %~1 %~2 %~3 %~4 %~5 %~6 %~7 %~8 %~9 works as expected. Excellent! Done. I'll upload Version 15 ASAP. It has this lyx.bat and a reLyX.bat for you ;-) Angus
Re: The LANG environment variable...
Jean-Marc == Jean-Marc Lasgouttes [EMAIL PROTECTED] writes: Angus == Angus Leeming [EMAIL PROTECTED] writes: You didn't look in the right place, obviously. google for gettext windows: http://gnuwin32.sourceforge.net/install.html#Native-language_support_ Angus However, see also the message I've just posted to the MinSYS Angus list: http://article.gmane.org/gmane.comp.gnu.mingw.msys/2611 Jean-Marc Actually the right place is intl/localename.c in 1.4.0cvs Jean-Marc :) There is native support for windows in gettext 0.13. Jean-Marc This probably means that if you manage to link against the Jean-Marc gettext provided with mingw tools, it should just work. Hello? Angus? Do you think it is possible to build LyX against the gettext provided with mingw? This would probably fix a lot of the language nastiness, and avoid setting of environment variables. JMarc
Re: The LANG environment variable...
Jean-Marc Lasgouttes wrote: Jean-Marc This probably means that if you manage to link against the Jean-Marc gettext provided with mingw tools, it should just work. Hello? Angus? Do you think it is possible to build LyX against the gettext provided with mingw? This would probably fix a lot of the language nastiness, and avoid setting of environment variables. Sorry, I guess that I missed this bit of your mail. I could certainly try, but I don't see what it gains us. There's about 20 lines in the installer to set the language of the UI. Moreover, because it is encapsulated in a lyx.bat file, it's trivially easy for people to change. I see on http://www.mingw.org/download.shtml that I would be grabbing gettext-0.11.5-2003.02.01-1-src.tar.bz2 libiconv-1.8-2003.02.01-1-src.tar.bz2 Do you want me to try this anyway? Angus (currently running lyx in french on an otherwise entirely english box)
Re: The LANG environment variable...
Angus == Angus Leeming [EMAIL PROTECTED] writes: Angus Sorry, I guess that I missed this bit of your mail. Angus I could certainly try, but I don't see what it gains us. Angus There's about 20 lines in the installer to set the language of Angus the UI. Moreover, because it is encapsulated in a lyx.bat file, Angus it's trivially easy for people to change. OK, if you are satisfied about how things work now, I guess it is not worth trying it after all. I agree that the .bat file solution is simple enough. Angus I see on http://www.mingw.org/download.shtml that I would be Angus grabbing gettext-0.11.5-2003.02.01-1-src.tar.bz2 Angus libiconv-1.8-2003.02.01-1-src.tar.bz2 Do you want me to try Angus this anyway? I thought it would be present by default in the build tools. Angus Angus (currently running lyx in french on an otherwise entirely Angus english box) Lucky guy! JMarc
Re: The LANG environment variable...
Lars Gullik Bjønnes wrote: | Both appear to be quite common. google on nn_NO and on no_NY. Note | that the po file is nn.po... I'll apply this. thanks and regards Uwe
Re: The LANG environment variable...
Jean-Marc Lasgouttes wrote: Angus Sorry, I guess that I missed this bit of your mail. Angus I could certainly try, but I don't see what it gains us. Angus There's about 20 lines in the installer to set the language of Angus the UI. Moreover, because it is encapsulated in a lyx.bat file, Angus it's trivially easy for people to change. OK, if you are satisfied about how things work now, I guess it is not worth trying it after all. I agree that the .bat file solution is simple enough. Angus I see on http://www.mingw.org/download.shtml that I would be Angus grabbing gettext-0.11.5-2003.02.01-1-src.tar.bz2 Angus libiconv-1.8-2003.02.01-1-src.tar.bz2 Do you want me to try Angus this anyway? I thought it would be present by default in the build tools. Is is now. I ran the libiconv and gettext installers. However, when I now configure 1.3.x without --with-included-gettext, the tests for gettext fail: #include libintl.h extern int _nl_msg_cat_cntr; int main () { bindtextdomain (, ); return (int) gettext () + _nl_msg_cat_cntr ; return 0; } $ gcc -o conftest.exe -g -O2 -Wl,--export-all-symbols conftest.c -lm -lintl -li conv C:/DOCUME~1/Angus/LOCALS~1/Temp/ccwjbaaa.o: In function `main': J:/MinSYS/home/Angus/lyx/13x/build/conftest.c:7: undefined reference to `_nl_msg_cat_cntr' collect2: ld returned 1 exit status No less a person than Bruno Haible explains here: http://lists.gnu.org/archive/html/bug-gnu-utils/2001-05/msg00339.html that the gettext-0.10.35 m4 macros are at fault. I propose not to persue this further as I understand you use gettext-0.13 in the 1.4.x tree and things work well enough --with-included-gettext in teh 1.3.x tree. Angus
Re: The LANG environment variable...
Angus == Angus Leeming [EMAIL PROTECTED] writes: Angus I propose not to persue this further as I understand you use Angus gettext-0.13 in the 1.4.x tree and things work well enough Angus --with-included-gettext in teh 1.3.x tree. Sure. Thanks a lot to testing that. JMarc
Re: The LANG environment variable...
Angus Leeming [EMAIL PROTECTED] writes: Enrico Forestieri wrote: Helge Hafting helge.hafting at ... writes: To avoid double quoting the ~ character should be used. So: lyx.exe %~1 %~2 %~3 %~4 %~5 %~6 %~7 %~8 %~9 works as expected. Excellent! Done. I'll upload Version 15 ASAP. It has this lyx.bat and a reLyX.bat for you Angus Thank you Angus, however I think it is better to simply use lyx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 otherwise lyx.exe would get called like this: lyx.exe file.lyx and it would ask you if you want to create a file with no name for eight times! This is not harmful, because you should take care to quote the file if it has spaces (the explorer windows always quote the filenames they pass in). On the other hand, if you omit the quotes and use: lyx.exe %~1 %~2 %~3 %~4 %~5 %~6 %~7 %~8 %~9 then if a passed argument was quoted it gets unquoted and problems arise if there were spaces. I really hate Windows :-( As regards v15 I just tried it. 1) I have no LANG variable set in my preferences, but when starting a cmd.exe it is automatically set to my locale, so I cannot really choose a different language for the lyx GUI, unless modifying lyx.bat. 2) The reLyX script is not catched by the configure script, so I have no menu entries for importing a latex file (to fix this, the LyXdir/bin directory should be in the path the moment configure is called). 3) There still is the problem with symlinks in cygwin preventing to run successfully Edit-Reconfigure if one has miktex (it is not a problem with the cygwin latex package). Please, keep in mind that I am reporting this to help you fine tuning the installer for the casual user, as I am able to fix these small problems for myself. Thank you all again for your great work! Enrico
Re: The LANG environment variable...
Angus Leeming [EMAIL PROTECTED] writes: Enrico Forestieri wrote: [snip] Launching the last command in the bat file with start should do the trick. $ cat lyx.bat at echo off rem rem some stuff here rem start lyx.exe Enrico I'm afraid that doesn't work. How odd. It works in my Win2k. Anyway, I lost my hope for a consistent behavior in Windows. In my opinion, the phase of the moon also plays a role in Windows ;-) Enrico
Re: The LANG environment variable...
Angus Leeming wrote: On Tuesday 14 June 2005 21:34, Andre Poenitz wrote: On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: if "%LANG%"=="" SET LANG=no_NO lyx.exe %* [...] Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) I don't think it works on older Windows versions. I've seen %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume that it can't be a mere oversight of lazy programmers... I tested with windows98 - windows98 don't support .cmd files (they have to end in .bat instead), and there is no support for %* So it depends on how old windows versions you want to support. Of course %1 %2 %3 ... works on newer windows too, but limits you to 9 arguments. (You can probably get more by using some ugly tricks with the "shift" command...) In that case, shouldn't it be lyx.exe "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" No, that will turn lyx.bat "file with spaces.lyx" into lyx.exe ""file with spaces.lyx"" and that won't work too well. The windows shell is like most other ms software - not well planned for corner cases. If you pass a filename with quotes to a windows batchfile, then the quotes are preserved as part of the %1 variable. Any subsequent use of %1 will retain the quotes. So they shouldn't be necessary, at least not on windows98. Helge Hafting
Re: The LANG environment variable...
Andre Poenitz wrote: On Tue, Jun 14, 2005 at 10:45:07AM +0200, Asger Alstrup wrote: Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer but rather would get the configure script to output \ui_language de_DE to lyxrc.defaults. Thoughts? Looks good to me. I was thinking the same, except that I was leaning towards a command-line option, but lyxrc will do for me as well. The command line option is 'LANG=de_DE lyx' in a decent shell. That'll be 'set LANG=de_DE' in the windows shell. Helge Hafting
Re: The LANG environment variable...
Helge Hafting wrote: Angus Leeming wrote: On Tuesday 14 June 2005 21:34, Andre Poenitz wrote: On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: if "%LANG%"=="" SET LANG=no_NO lyx.exe %* [...] Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) I don't think it works on older Windows versions. I've seen %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume that it can't be a mere oversight of lazy programmers... I tested with windows98 - windows98 don't support .cmd files (they have to end in .bat instead), and there is no support for %* So it depends on how old windows versions you want to support. Of course %1 %2 %3 ... works on newer windows too, but limits you to 9 arguments. (You can probably get more by using some ugly tricks with the "shift" command...) In that case, shouldn't it be lyx.exe "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" No, that will turn lyx.bat "file with spaces.lyx" into lyx.exe ""file with spaces.lyx"" and that won't work too well. The windows shell is like most other ms software - not well planned for corner cases. If you pass a filename with quotes to a windows batchfile, then the quotes are preserved as part of the %1 variable. Any subsequent use of %1 will retain the quotes. So they shouldn't be necessary, at least not on windows98. Helge Hafting Hi, Helge. Thanks for the info. I've been testing things out and have two remaining problems: 1. Creating short cuts from the desktop and from the start menu to c:\Program Files\LyX\bin\lyx.bat works perfectly well, but my icons are replaced with that of a .bat file. Any idea how to get back to the icon embedded in lyx.exe? 2 Launching LyX at the end of the installer as !define PRODUCT_BAT "$INSTDIR\bin\lyx.bat" !define MUI_FINISHPAGE_RUN "${PRODUCT_BAT}" works perfectly well, but I get a bloody great cmd window in the background. How do I make it go away? :-) Angus
Re: The LANG environment variable...
Angus Leeming wrote: I've been testing things out and have two remaining problems: 1. Creating short cuts from the desktop and from the start menu to c:\Program Files\LyX\bin\lyx.bat works perfectly well, but my icons are replaced with that of a .bat file. Any idea how to get back to the icon embedded in lyx.exe? Resolved. Read the documentation, Angus! 2 Launching LyX at the end of the installer as !define PRODUCT_BAT "$INSTDIR\bin\lyx.bat" !define MUI_FINISHPAGE_RUN "${PRODUCT_BAT}" works perfectly well, but I get a bloody great cmd window in the background. How do I make it go away? :-) Still to resolve. Angus
Re: The LANG environment variable...
Angus Leeming wrote: Putting the two dataabses together: nn_NO Nynorsk It is no_NY. I put some code tables on http://fkurth.de/uwest/LyX/Installer/LangCodes/ regards Uwe
Re: The LANG environment variable...
Uwe Stöhr wrote: nn_NO Nynorsk It is no_NY. Both appear to be quite common. google on "nn_NO" and on "no_NY". Note that the po file is nn.po... Angus
Re: The LANG environment variable...
Angus Leeming <[EMAIL PROTECTED]> writes: | Uwe Stöhr wrote: >>> nn_NO Nynorsk >> It is no_NY. > | Both appear to be quite common. google on "nn_NO" and on "no_NY". Note | that the po file is nn.po... I think it really should be "nn". nn is the language XX is the country. en_EN is english in england en_US is english in the us nn_NO "nynorsk" in norway no_NO "norsk" aka bokmål in norway. no_NY just seems wrong. -- Lgb
Re: The LANG environment variable...
Helge Hafting <[EMAIL PROTECTED]> writes: > > Angus Leeming wrote: > [snip] > >In that case, shouldn't it be > > > >lyx.exe "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" > > > > > > > No, that will turn > lyx.bat "file with spaces.lyx" > into > lyx.exe ""file with spaces.lyx"" and that won't work too well. > To avoid double quoting the ~ character should be used. So: lyx.exe "%~1" "%~2" "%~3" "%~4" "%~5" "%~6" "%~7" "%~8" "%~9" works as expected. Enrico
Re: The LANG environment variable...
Angus Leeming <[EMAIL PROTECTED]> writes: > > 2 Launching LyX at the end of the installer as > >!define PRODUCT_BAT "$INSTDIR\bin\lyx.bat" > >!define MUI_FINISHPAGE_RUN "${PRODUCT_BAT}" > > works perfectly well, but I get a bloody great cmd window in the > > background. How do I make it go away? > > Still to resolve. > Angus Launching the last command in the bat file with "start" should do the trick. $ cat lyx.bat @echo off rem rem some stuff here rem start lyx.exe Enrico
Re: The LANG environment variable...
Enrico Forestieri wrote: Angus Leeming <[EMAIL PROTECTED]> writes: 2 Launching LyX at the end of the installer as !define PRODUCT_BAT "$INSTDIR\bin\lyx.bat" !define MUI_FINISHPAGE_RUN "${PRODUCT_BAT}" works perfectly well, but I get a bloody great cmd window in the background. How do I make it go away? Still to resolve. Angus Launching the last command in the bat file with "start" should do the trick. $ cat lyx.bat @echo off rem rem some stuff here rem start lyx.exe Enrico I'm afraid that doesn't work. But anyway, I went a different route: !define MUI_FINISHPAGE_RUN !define MUI_FINISHPAGE_TEXT "$(FinishPageMessage)" !define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageRun)" !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchProduct" !insertmacro MUI_PAGE_FINISH Function LaunchProduct lyx_configure::set_env LANG $LangCode Exec ${PRODUCT_EXE} FunctionEnd where lyx_configure is a .dll containing (among other things): // Set an environment variable extern "C" void __declspec(dllexport) set_env(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { EXDLL_INIT(); std::string const var_name = pop_from_stack(); std::string const var_value = pop_from_stack(); SetEnvironmentVariableA(var_name.c_str(), var_value.c_str()); pushstring("0"); } Angus
Re: The LANG environment variable...
Enrico Forestieri wrote: Helge Hafting <[EMAIL PROTECTED]> writes: To avoid double quoting the ~ character should be used. So: lyx.exe "%~1" "%~2" "%~3" "%~4" "%~5" "%~6" "%~7" "%~8" "%~9" works as expected. Excellent! Done. I'll upload Version 15 ASAP. It has this lyx.bat and a reLyX.bat for you ;-) Angus
Re: The LANG environment variable...
> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: >>> You didn't look in the right place, obviously. google for "gettext >>> windows": >>> >>> http://gnuwin32.sourceforge.net/install.html#Native-language_support_ Angus> However, see also the message I've just posted to the MinSYS Angus> list: http://article.gmane.org/gmane.comp.gnu.mingw.msys/2611 Jean-Marc> Actually the right place is intl/localename.c in 1.4.0cvs Jean-Marc> :) There is native support for windows in gettext > 0.13. Jean-Marc> This probably means that if you manage to link against the Jean-Marc> gettext provided with mingw tools, it should just work. Hello? Angus? Do you think it is possible to build LyX against the gettext provided with mingw? This would probably fix a lot of the language nastiness, and avoid setting of environment variables. JMarc
Re: The LANG environment variable...
Jean-Marc Lasgouttes wrote: Jean-Marc> This probably means that if you manage to link against the Jean-Marc> gettext provided with mingw tools, it should just work. Hello? Angus? Do you think it is possible to build LyX against the gettext provided with mingw? This would probably fix a lot of the language nastiness, and avoid setting of environment variables. Sorry, I guess that I missed this bit of your mail. I could certainly try, but I don't see what it gains us. There's about 20 lines in the installer to set the language of the UI. Moreover, because it is encapsulated in a lyx.bat file, it's trivially easy for people to change. I see on http://www.mingw.org/download.shtml that I would be grabbing gettext-0.11.5-2003.02.01-1-src.tar.bz2 libiconv-1.8-2003.02.01-1-src.tar.bz2 Do you want me to try this anyway? Angus (currently running lyx in french on an otherwise entirely english box)
Re: The LANG environment variable...
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: Angus> Sorry, I guess that I missed this bit of your mail. Angus> I could certainly try, but I don't see what it gains us. Angus> There's about 20 lines in the installer to set the language of Angus> the UI. Moreover, because it is encapsulated in a lyx.bat file, Angus> it's trivially easy for people to change. OK, if you are satisfied about how things work now, I guess it is not worth trying it after all. I agree that the .bat file solution is simple enough. Angus> I see on http://www.mingw.org/download.shtml that I would be Angus> grabbing gettext-0.11.5-2003.02.01-1-src.tar.bz2 Angus> libiconv-1.8-2003.02.01-1-src.tar.bz2 Do you want me to try Angus> this anyway? I thought it would be present by default in the build tools. Angus> Angus (currently running lyx in french on an otherwise entirely Angus> english box) Lucky guy! JMarc
Re: The LANG environment variable...
Lars Gullik Bjønnes wrote: | Both appear to be quite common. google on "nn_NO" and on "no_NY". Note | that the po file is nn.po... I'll apply this. thanks and regards Uwe
Re: The LANG environment variable...
Jean-Marc Lasgouttes wrote: Angus> Sorry, I guess that I missed this bit of your mail. Angus> I could certainly try, but I don't see what it gains us. Angus> There's about 20 lines in the installer to set the language of Angus> the UI. Moreover, because it is encapsulated in a lyx.bat file, Angus> it's trivially easy for people to change. OK, if you are satisfied about how things work now, I guess it is not worth trying it after all. I agree that the .bat file solution is simple enough. Angus> I see on http://www.mingw.org/download.shtml that I would be Angus> grabbing gettext-0.11.5-2003.02.01-1-src.tar.bz2 Angus> libiconv-1.8-2003.02.01-1-src.tar.bz2 Do you want me to try Angus> this anyway? I thought it would be present by default in the build tools. Is is now. I ran the libiconv and gettext installers. However, when I now configure 1.3.x without --with-included-gettext, the tests for gettext fail: #include extern int _nl_msg_cat_cntr; int main () { bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr ; return 0; } $ gcc -o conftest.exe -g -O2 -Wl,--export-all-symbols conftest.c -lm -lintl -li conv C:/DOCUME~1/Angus/LOCALS~1/Temp/ccwjbaaa.o: In function `main': J:/MinSYS/home/Angus/lyx/13x/build/conftest.c:7: undefined reference to `_nl_msg_cat_cntr' collect2: ld returned 1 exit status No less a person than Bruno Haible explains here: http://lists.gnu.org/archive/html/bug-gnu-utils/2001-05/msg00339.html that the gettext-0.10.35 m4 macros are at fault. I propose not to persue this further as I understand you use gettext-0.13 in the 1.4.x tree and things work well enough --with-included-gettext in teh 1.3.x tree. Angus
Re: The LANG environment variable...
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: Angus> I propose not to persue this further as I understand you use Angus> gettext-0.13 in the 1.4.x tree and things work well enough Angus> --with-included-gettext in teh 1.3.x tree. Sure. Thanks a lot to testing that. JMarc
Re: The LANG environment variable...
Angus Leeming <[EMAIL PROTECTED]> writes: > > Enrico Forestieri wrote: > > Helge Hafting ...> writes: > > To avoid double quoting the ~ character should be used. So: > > lyx.exe "%~1" "%~2" "%~3" "%~4" "%~5" "%~6" "%~7" "%~8" "%~9" > > works as expected. > > Excellent! Done. > > I'll upload Version 15 ASAP. It has this lyx.bat and a reLyX.bat for you > > Angus Thank you Angus, however I think it is better to simply use lyx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 otherwise lyx.exe would get called like this: lyx.exe "file.lyx" "" "" "" "" "" "" "" "" and it would ask you if you want to create a file with no name for eight times! This is not harmful, because you should take care to quote the file if it has spaces (the explorer windows always quote the filenames they pass in). On the other hand, if you omit the quotes and use: lyx.exe %~1 %~2 %~3 %~4 %~5 %~6 %~7 %~8 %~9 then if a passed argument was quoted it gets unquoted and problems arise if there were spaces. I really hate Windows :-( As regards v15 I just tried it. 1) I have no LANG variable set in my preferences, but when starting a cmd.exe it is automatically set to my locale, so I cannot really choose a different language for the lyx GUI, unless modifying lyx.bat. 2) The reLyX script is not catched by the configure script, so I have no menu entries for importing a latex file (to fix this, the /bin directory should be in the path the moment configure is called). 3) There still is the problem with symlinks in cygwin preventing to run successfully Edit->Reconfigure if one has miktex (it is not a problem with the cygwin latex package). Please, keep in mind that I am reporting this to help you fine tuning the installer for the casual user, as I am able to fix these small problems for myself. Thank you all again for your great work! Enrico
Re: The LANG environment variable...
Angus Leeming <[EMAIL PROTECTED]> writes: > > Enrico Forestieri wrote: [snip] > > Launching the last command in the bat file with "start" should do the trick. > > > > $ cat lyx.bat > > echo off > > rem > > rem some stuff here > > rem > > start lyx.exe > > > > Enrico > > I'm afraid that doesn't work. How odd. It works in my Win2k. Anyway, I lost my hope for a consistent behavior in Windows. In my opinion, the phase of the moon also plays a role in Windows ;-) Enrico
Re: The LANG environment variable...
Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer but rather would get the configure script to output \ui_language de_DE to lyxrc.defaults. Thoughts? Looks good to me. I was thinking the same, except that I was leaning towards a command-line option, but lyxrc will do for me as well. Regards, Asger
Re: The LANG environment variable...
Angus == Angus Leeming [EMAIL PROTECTED] writes: Angus ...is used, of course, to control l10n of the UI. (How about Angus that for jargon!) Trouble is, it's not very intuitive to Angus Windows users. I wonder if it would not be good to have a Angus LyXRC::ui_language variable and get LyX to set LANG if it isn't Angus empty: What we should really do is query the language from windows and just use that. That cannot be so difficult to achieve... The main problem of course is that windows has different names for these locales. Is locale.alias installed currently in the locale/ directory? Would that help to have it? [later...] I searched the web to find references on using gettext with win32 api, and I have to say I found nothing. Aren't there other unix apps that use gettext and got ported to windows? JMarc
Re: The LANG environment variable...
Jean-Marc Lasgouttes wrote: Angus == Angus Leeming [EMAIL PROTECTED] writes: Angus ...is used, of course, to control l10n of the UI. (How about Angus that for jargon!) Trouble is, it's not very intuitive to Angus Windows users. I wonder if it would not be good to have a Angus LyXRC::ui_language variable and get LyX to set LANG if it isn't Angus empty: What we should really do is query the language from windows and just use that. That cannot be so difficult to achieve... Hmmm. Having tried out my idea (patch attached) I think you're right. The patch has no effect because gettext_init is called so early --- way before the lyxrc files are parsed. The main problem of course is that windows has different names for these locales. Is locale.alias installed currently in the locale/ directory? Would that help to have it? $ ls /mnt/windowsC/Program\ Files/LyX/Resources/locale da de es eu fi fr it locale.alias nl nn no pl ro ru sk sl tr I attach this file also. How is it meant to be used? [later...] I searched the web to find references on using gettext with win32 api, and I have to say I found nothing. Aren't there other unix apps that use gettext and got ported to windows? You didn't look in the right place, obviously. google for gettext windows: http://gnuwin32.sourceforge.net/install.html#Native-language_support_ Native-language support Most GNU packages have the ability to output messages in several languages. This native-language support (NLS) requires the LibIntl and the LibIconv libraries. On MS-Windows they have been adapted so that NLS chooses the system language, unless one of the environment variables LANG or LANGUAGE has been set. The language codes (ISO 639) for these environment variables are different from the MS-Windows ones. When using a program in a console window (command.com or cmd.exe) and setting LANG or LANGUAGE, you must also set the correct code page with the chcp command; for European languages, code page 1252 usually suffices. I read that as saying that the UI should just work. We shouldn't need to set LANG. Hm. I wonder if this gnuwin32 behaviour is different to MinSYS's and whose version of libIntl, LibIconv I have installed? -- Angus# Locale name alias data base. # Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # The format of this file is the same as for the corresponding file of # the X Window System, which normally can be found in # /usr/lib/X11/locale/locale.alias # A single line contains two fields: an alias and a substitution value. # All entries are case independent. # Note: This file is far from being complete. If you have a value for # your own site which you think might be useful for others too, share # it with the rest of us. Send it using the `glibcbug' script to # [EMAIL PROTECTED] # Packages using this file: lyx bokmal no_NO.ISO-8859-1 bokmål no_NO.ISO-8859-1 catalan ca_ES.ISO-8859-1 croatianhr_HR.ISO-8859-2 czech cs_CZ.ISO-8859-2 danish da_DK.ISO-8859-1 dansk da_DK.ISO-8859-1 deutsch de_DE.ISO-8859-1 dutch nl_NL.ISO-8859-1 eesti et_EE.ISO-8859-1 estonianet_EE.ISO-8859-1 finnish fi_FI.ISO-8859-1 françaisfr_FR.ISO-8859-1 french fr_FR.ISO-8859-1 galego gl_ES.ISO-8859-1 galiciangl_ES.ISO-8859-1 german de_DE.ISO-8859-1 greek el_GR.ISO-8859-7 hebrew he_IL.ISO-8859-8 hrvatskihr_HR.ISO-8859-2 hungarian hu_HU.ISO-8859-2 icelandic is_IS.ISO-8859-1 italian it_IT.ISO-8859-1 japaneseja_JP.eucJP japanese.eucja_JP.eucJP ja_JP ja_JP.eucJP ja_JP.ujis ja_JP.eucJP japanese.sjis ja_JP.SJIS korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR lithuanian lt_LT.ISO-8859-13 nb_NO no_NO.ISO-8859-1 nb_NO.ISO-8859-1 no_NO.ISO-8859-1 norwegian no_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 portuguese pt_PT.ISO-8859-1 romanianro_RO.ISO-8859-2 russian ru_RU.ISO-8859-5 slovak sk_SK.ISO-8859-2 slovene sl_SI.ISO-8859-2 slovenian sl_SI.ISO-8859-2 spanish
Re: The LANG environment variable...
Angus Leeming wrote: ...is used, of course, to control l10n of the UI. (How about that for jargon!) Trouble is, it's not very intuitive to Windows users. I wonder if it would not be good to have a LyXRC::ui_language variable and get LyX to set LANG if it isn't empty: Possibly a good solution. Here is an easy solution, a lyx.cmd script that tests LANG and sets it if necessary: lyx.cmd: if %LANG%== SET LANG=no_NO lyx.exe %* First line tests LANG, and sets it to Norwegian if it isn't already set to something. Obviously, this script line should be written by the installer program, so users can choose some other default language at install time. Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) Helge Hafting
Re: The LANG environment variable...
Angus Leeming wrote: I read that as saying that the UI should just work. We shouldn't need to set LANG. Probably it would not just work, because we mess around with LC_ALL because of buffer translation in messages.C. Georg
Re: The LANG environment variable...
Helge Hafting wrote: Angus Leeming wrote: ...is used, of course, to control l10n of the UI. (How about that for jargon!) Trouble is, it's not very intuitive to Windows users. I wonder if it would not be good to have a LyXRC::ui_language variable and get LyX to set LANG if it isn't empty: Possibly a good solution. Here is an easy solution, a lyx.cmd script that tests LANG and sets it if necessary: lyx.cmd: if %LANG%== SET LANG=no_NO lyx.exe %* Ok, this would work and would be easy to do in the installer. It's better than Uwe's current solution which sets LANG globally because there's no global pollution. Taken with Georg's post, I think I'll go down this route. -- Angus
Re: The LANG environment variable...
Angus Leeming wrote: Jean-Marc Lasgouttes wrote: Angus ...is used, of course, to control l10n of the UI. (How about Angus that for jargon!) Trouble is, it's not very intuitive to Angus Windows users. I wonder if it would not be good to have a Angus LyXRC::ui_language variable and get LyX to set LANG if it isn't Angus empty: What we should really do is query the language from windows and just use that. That cannot be so difficult to achieve... Hmmm. Having tried out my idea (patch attached) I think you're right. The patch has no effect because gettext_init is called so early --- way before the lyxrc files are parsed. The main problem of course is that windows has different names for these locales. Is locale.alias installed currently in the locale/ directory? Would that help to have it? $ ls /mnt/windowsC/Program\ Files/LyX/Resources/locale da de es eu fi fr it locale.alias nl nn no pl ro ru sk sl tr I attach this file also. How is it meant to be used? [later...] I searched the web to find references on using gettext with win32 api, and I have to say I found nothing. Aren't there other unix apps that use gettext and got ported to windows? You didn't look in the right place, obviously. google for gettext windows: http://gnuwin32.sourceforge.net/install.html#Native-language_support_ However, see also the message I've just posted to the MinSYS list: http://article.gmane.org/gmane.comp.gnu.mingw.msys/2611 -- Angus
Re: The LANG environment variable...
Angus Leeming [EMAIL PROTECTED] writes: | ...is used, of course, to control l10n of the UI. (How about that for | jargon!) Trouble is, it's not very intuitive to Windows users. I wonder if | it would not be good to have a LyXRC::ui_language variable and get LyX to | set LANG if it isn't empty: | +if (!lyxrc.ui_language.empty()) | +setEnv(LANG, lyxrc.ui_language); | + This won't work on UNIX (we have more than one way to skin the cat there) -- Lgb
Re: The LANG environment variable...
Angus == Angus Leeming [EMAIL PROTECTED] writes: You didn't look in the right place, obviously. google for gettext windows: http://gnuwin32.sourceforge.net/install.html#Native-language_support_ Angus However, see also the message I've just posted to the MinSYS Angus list: http://article.gmane.org/gmane.comp.gnu.mingw.msys/2611 Actually the right place is intl/localename.c in 1.4.0cvs :) There is native support for windows in gettext 0.13. This probably means that if you manage to link against the gettext provided with mingw tools, it should just work. Switching to a recent gettext in 0.13 is probably more work, and I'd rather avoid that if possible. JMarc
Re: The LANG environment variable...
Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer Now that I've invested my time you will change it :-(. (Just joking) rather would get the configure script to output \ui_language de_DE to lyxrc.defaults. Fine with me. regards Uwe
Re: The LANG environment variable...
Uwe Sthr wrote: Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer Now that I've invested my time you will change it :-(. (Just joking) :-) No you're not. Uwe, We have these po files in 1.3.x: bg ca cs da de es eu fi fr he hu it nl nn no pl pt ro ru sk sl sv tr wa and your installer dropdown has these language strings: Dansk|Deutsch|English|Espagol|Euskara|Franais|Italiano| Nederlands|Norsk|Nynorsk|Polski|Romna|Russian|Slovencina| Slovencina|Suomi|Trke Why 2 Slovencina entries? Putting the two dataabses together: bg ca cs da Dansk de Deutsch es Espagol eu Euskara fi Suomi fr Franais he hu it Italiano nl Nederlands nn Nynorsk no Norsk pl Polski pt ro Romna ru sk sl Slovencina|Slovencina sv tr Trke wa Has anybody any idea where I'd get the rest? Angus
Re: The LANG environment variable...
Angus Leeming wrote: Putting the two dataabses together: bg_BG ca_ES Catal cs_CZ etina da_DK Dansk de_DE Deutsch en_US English es_ES Espaol eu Euskara fi_FI Suomi fr_FR Franais he_IL hu_HU Magyar it_IT Italiano nl_NL Nederlands nn_NO Nynorsk no_NO Norsk Bokml pl_PL Polski pt_PT Portugus ro_RO Romna ru_RU sk_SK Slovensk sl_SI Slovenina sv_SE Svenska tr_TR Trke wa_BE Walon
Re: The LANG environment variable...
Angus Leeming wrote: Uwe, We have these po files in 1.3.x: bg ca cs da de es eu fi fr he hu it nl nn no pl pt ro ru sk sl sv tr wa and your installer dropdown has these language strings: Dansk|Deutsch|English|Espagol|Euskara|Franais|Italiano| Nederlands|Norsk|Nynorsk|Polski|Romna|Russian|Slovencina| Slovencina|Suomi|Trke I only used the languages that have enough translated strings listed here: http://www.devel.lyx.org/i18n.php3 Should I really enable all languages? Why 2 Slovencina entries? I could bet that somebody will complain about this. I copied the names from http://en.wikipedia.org/wiki/Slovak_language and http://en.wikipedia.org/wiki/Slovenian_language But to clearify the difference I'll use Slovensk instead of Slovenina. bg_BG ca_ES Catal cs_CZ etina da_DK Dansk de_DE Deutsch en_US English es_ES Espaol eu Euskara fi_FI Suomi fr_FR Franais he_IL hu_HU Magyar it_IT Italiano nl_NL Nederlands nn_NO Nynorsk no_NO Norsk Bokml pl_PL Polski pt_PT Portugus ro_RO Romna ru_RU sk_SK Slovensk sl_SI Slovenina sv_SE Svenska tr_TR Trke wa_BE Walon Thanks for the language names but NSIS don't accept Unicode or kyrillic. Chars in this encoding will appear invisible. This restriction is due to NSIS's support for 98/ME as these OSes can't handle unicode. eu Euskara eu_EU Euskara thanks and regards Uwe
Re: The LANG environment variable...
Uwe Sthr wrote: Thanks for the language names but NSIS don't accept Unicode or kyrillic. Chars in this encoding will appear invisible. This restriction is due to NSIS's support for 98/ME as these OSes can't handle unicode. Hmmm. googling on nsis LOCALE_LANGUAGE_NAME hebrew pulls up http://cvs.limewire.org/fisheye/viewrep/~raw,r=1.51/limecvs/lib/messagebundles/MessagesBundle_iw.properties googling on nsis LOCALE_LANGUAGE_NAME czech pulls up http://cvs.limewire.org/fisheye/viewrep/~raw,r=1.50/limecvs/lib/messagebundles/MessagesBundle_cs.UTF-8.txt It seems that you *can* input non-latin-1 stuff, at least some of the time. Angus
Re: The LANG environment variable...
Angus Leeming wrote: googling on nsis LOCALE_LANGUAGE_NAME hebrew pulls up http://cvs.limewire.org/fisheye/viewrep/~raw,r=1.51/limecvs/lib/messagebundles/MessagesBundle_iw.properties Oh this looks complicated and I'm not sure it it's possible to get hebrew, kyrillic, and latin displayed in one page. Another problem: Whenever I checkout CVS I get e.g. version lyx_path_prefix.C in revision 1.3 (08-06) instead of revision 1.1.2.3 (09-06), also If I use the CVS interface from lyx.org. The same is for the other files. What is the right CVS checkout comand to get the actual version? Could you tag new versions as e.g. 1.3.1 instead of 1.1.2.3. It confuses me a bit. regards Uwe
Re: The LANG environment variable...
I wrote: Whenever I checkout CVS I get e.g. version lyx_path_prefix.C in revision 1.3 (08-06) instead of revision 1.1.2.3 (09-06), also If I use the CVS interface from lyx.org. Argh I checked out HEAD insted of the branch! I need a break now. sorry Uwe
Re: The LANG environment variable...
On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: if %LANG%== SET LANG=no_NO lyx.exe %* [...] Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) I don't think it works on older Windows versions. I've seen %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume that it can't be a mere oversight of lazy programmers... Andre'
Re: The LANG environment variable...
On Tue, Jun 14, 2005 at 10:45:07AM +0200, Asger Alstrup wrote: Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer but rather would get the configure script to output \ui_language de_DE to lyxrc.defaults. Thoughts? Looks good to me. I was thinking the same, except that I was leaning towards a command-line option, but lyxrc will do for me as well. The command line option is 'LANG=de_DE lyx' in a decent shell. SCNR. Andre'
Re: The LANG environment variable...
On Tuesday 14 June 2005 21:34, Andre Poenitz wrote: On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: if %LANG%== SET LANG=no_NO lyx.exe %* [...] Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) I don't think it works on older Windows versions. I've seen %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume that it can't be a mere oversight of lazy programmers... In that case, shouldn't it be lyx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 ? Angus
Re: The LANG environment variable...
Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer but rather would get the configure script to output \ui_language de_DE to lyxrc.defaults. Thoughts? Looks good to me. I was thinking the same, except that I was leaning towards a command-line option, but lyxrc will do for me as well. Regards, Asger
Re: The LANG environment variable...
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: Angus> ...is used, of course, to control l10n of the UI. (How about Angus> that for jargon!) Trouble is, it's not very intuitive to Angus> Windows users. I wonder if it would not be good to have a Angus> LyXRC::ui_language variable and get LyX to set LANG if it isn't Angus> empty: What we should really do is query the language from windows and just use that. That cannot be so difficult to achieve... The main problem of course is that windows has different names for these locales. Is locale.alias installed currently in the locale/ directory? Would that help to have it? [later...] I searched the web to find references on using gettext with win32 api, and I have to say I found nothing. Aren't there other unix apps that use gettext and got ported to windows? JMarc
Re: The LANG environment variable...
Jean-Marc Lasgouttes wrote: >> "Angus" == Angus Leeming <[EMAIL PROTECTED]> >> writes: > > Angus> ...is used, of course, to control l10n of the UI. (How about > Angus> that for jargon!) Trouble is, it's not very intuitive to > Angus> Windows users. I wonder if it would not be good to have a > Angus> LyXRC::ui_language variable and get LyX to set LANG if it isn't > Angus> empty: > > What we should really do is query the language from windows and just > use that. That cannot be so difficult to achieve... Hmmm. Having tried out my idea (patch attached) I think you're right. The patch has no effect because gettext_init is called so early --- way before the lyxrc files are parsed. > The main problem of course is that windows has different names for > these locales. Is locale.alias installed currently in the locale/ > directory? Would that help to have it? $ ls /mnt/windowsC/Program\ Files/LyX/Resources/locale da de es eu fi fr it locale.alias nl nn no pl ro ru sk sl tr I attach this file also. How is it meant to be used? > [later...] > > I searched the web to find references on using gettext with win32 api, > and I have to say I found nothing. Aren't there other unix apps that > use gettext and got ported to windows? You didn't look in the right place, obviously. google for "gettext windows": http://gnuwin32.sourceforge.net/install.html#Native-language_support_ Native-language support Most GNU packages have the ability to output messages in several languages. This native-language support (NLS) requires the LibIntl and the LibIconv libraries. On MS-Windows they have been adapted so that NLS chooses the system language, unless one of the environment variables LANG or LANGUAGE has been set. The language codes (ISO 639) for these environment variables are different from the MS-Windows ones. When using a program in a console window (command.com or cmd.exe) and setting LANG or LANGUAGE, you must also set the correct code page with the chcp command; for European languages, code page 1252 usually suffices. I read that as saying that the UI should just work. We shouldn't need to set LANG. Hm. I wonder if this gnuwin32 behaviour is different to MinSYS's and whose version of libIntl, LibIconv I have installed? -- Angus# Locale name alias data base. # Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # The format of this file is the same as for the corresponding file of # the X Window System, which normally can be found in # /usr/lib/X11/locale/locale.alias # A single line contains two fields: an alias and a substitution value. # All entries are case independent. # Note: This file is far from being complete. If you have a value for # your own site which you think might be useful for others too, share # it with the rest of us. Send it using the `glibcbug' script to # [EMAIL PROTECTED] # Packages using this file: lyx bokmal no_NO.ISO-8859-1 bokmål no_NO.ISO-8859-1 catalan ca_ES.ISO-8859-1 croatianhr_HR.ISO-8859-2 czech cs_CZ.ISO-8859-2 danish da_DK.ISO-8859-1 dansk da_DK.ISO-8859-1 deutsch de_DE.ISO-8859-1 dutch nl_NL.ISO-8859-1 eesti et_EE.ISO-8859-1 estonianet_EE.ISO-8859-1 finnish fi_FI.ISO-8859-1 françaisfr_FR.ISO-8859-1 french fr_FR.ISO-8859-1 galego gl_ES.ISO-8859-1 galiciangl_ES.ISO-8859-1 german de_DE.ISO-8859-1 greek el_GR.ISO-8859-7 hebrew he_IL.ISO-8859-8 hrvatskihr_HR.ISO-8859-2 hungarian hu_HU.ISO-8859-2 icelandic is_IS.ISO-8859-1 italian it_IT.ISO-8859-1 japaneseja_JP.eucJP japanese.eucja_JP.eucJP ja_JP ja_JP.eucJP ja_JP.ujis ja_JP.eucJP japanese.sjis ja_JP.SJIS korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR lithuanian lt_LT.ISO-8859-13 nb_NO no_NO.ISO-8859-1 nb_NO.ISO-8859-1 no_NO.ISO-8859-1 norwegian no_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 portuguese pt_PT.ISO-8859-1 romanianro_RO.ISO-8859-2 russian ru_RU.ISO-8859-5 slovak sk_SK.ISO-8859-2 slovene sl_SI.ISO-8859-2
Re: The LANG environment variable...
Angus Leeming wrote: ...is used, of course, to control l10n of the UI. (How about that for jargon!) Trouble is, it's not very intuitive to Windows users. I wonder if it would not be good to have a LyXRC::ui_language variable and get LyX to set LANG if it isn't empty: Possibly a good solution. Here is an easy solution, a lyx.cmd script that tests LANG and sets it if necessary: lyx.cmd: if "%LANG%"=="" SET LANG=no_NO lyx.exe %* First line tests LANG, and sets it to Norwegian if it isn't already set to something. Obviously, this script line should be written by the installer program, so users can choose some other default language at install time. Second line starts the lyx executable and passes any parameters to it. The script is tested on windows XP. (I don't have lyx for windows, but the LANG test and parameter passing works fine.) Helge Hafting
Re: The LANG environment variable...
Angus Leeming wrote: > I read that as saying that the UI should just work. We shouldn't need to > set LANG. Probably it would not just work, because we mess around with LC_ALL because of buffer translation in messages.C. Georg
Re: The LANG environment variable...
Helge Hafting wrote: > Angus Leeming wrote: > >>...is used, of course, to control l10n of the UI. (How about that for >>jargon!) Trouble is, it's not very intuitive to Windows users. I wonder >>if it would not be good to have a LyXRC::ui_language variable and get LyX >>to set LANG if it isn't empty: >> >> >> > Possibly a good solution. Here is an easy solution, a > lyx.cmd script that tests LANG and sets it if necessary: > > lyx.cmd: > if "%LANG%"=="" SET LANG=no_NO > lyx.exe %* Ok, this would work and would be easy to do in the installer. It's better than Uwe's current solution which sets LANG globally because there's no global pollution. Taken with Georg's post, I think I'll go down this route. -- Angus
Re: The LANG environment variable...
Angus Leeming wrote: > Jean-Marc Lasgouttes wrote: >> Angus> ...is used, of course, to control l10n of the UI. (How about >> Angus> that for jargon!) Trouble is, it's not very intuitive to >> Angus> Windows users. I wonder if it would not be good to have a >> Angus> LyXRC::ui_language variable and get LyX to set LANG if it isn't >> Angus> empty: >> >> What we should really do is query the language from windows and just >> use that. That cannot be so difficult to achieve... > > Hmmm. Having tried out my idea (patch attached) I think you're right. The > patch has no effect because gettext_init is called so early --- way > before the lyxrc files are parsed. > >> The main problem of course is that windows has different names for >> these locales. Is locale.alias installed currently in the locale/ >> directory? Would that help to have it? > > $ ls /mnt/windowsC/Program\ Files/LyX/Resources/locale > da de es eu fi fr it locale.alias nl nn no pl ro ru sk sl > tr > > I attach this file also. How is it meant to be used? > >> [later...] >> >> I searched the web to find references on using gettext with win32 api, >> and I have to say I found nothing. Aren't there other unix apps that >> use gettext and got ported to windows? > > You didn't look in the right place, obviously. google for "gettext > windows": > > http://gnuwin32.sourceforge.net/install.html#Native-language_support_ However, see also the message I've just posted to the MinSYS list: http://article.gmane.org/gmane.comp.gnu.mingw.msys/2611 -- Angus
Re: The LANG environment variable...
Angus Leeming <[EMAIL PROTECTED]> writes: | ...is used, of course, to control l10n of the UI. (How about that for | jargon!) Trouble is, it's not very intuitive to Windows users. I wonder if | it would not be good to have a LyXRC::ui_language variable and get LyX to | set LANG if it isn't empty: > | +if (!lyxrc.ui_language.empty()) | +setEnv("LANG", lyxrc.ui_language); | + This won't work on UNIX (we have more than one way to skin the cat there) -- Lgb
Re: The LANG environment variable...
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: >> You didn't look in the right place, obviously. google for "gettext >> windows": >> >> http://gnuwin32.sourceforge.net/install.html#Native-language_support_ Angus> However, see also the message I've just posted to the MinSYS Angus> list: http://article.gmane.org/gmane.comp.gnu.mingw.msys/2611 Actually the right place is intl/localename.c in 1.4.0cvs :) There is native support for windows in gettext > 0.13. This probably means that if you manage to link against the gettext provided with mingw tools, it should just work. Switching to a recent gettext in 0.13 is probably more work, and I'd rather avoid that if possible. JMarc
Re: The LANG environment variable...
Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer Now that I've invested my time you will change it :-(. (Just joking) rather would get the configure script to output \ui_language de_DE to lyxrc.defaults. Fine with me. regards Uwe
Re: The LANG environment variable...
Uwe Stöhr wrote: Angus Leeming wrote: That way, Uwe wouldn't set LANG globably from the Windows installer Now that I've invested my time you will change it :-(. (Just joking) :-) No you're not. Uwe, We have these po files in 1.3.x: bg ca cs da de es eu fi fr he hu it nl nn no pl pt ro ru sk sl sv tr wa and your installer dropdown has these language strings: Dansk|Deutsch|English|Espagñol|Euskara|Français|Italiano| Nederlands|Norsk|Nynorsk|Polski|Româna|Russian|Slovencina| Slovenšcina|Suomi|Türkçe Why 2 Slovencina entries? Putting the two dataabses together: bg ca cs da Dansk de Deutsch es Espagñol eu Euskara fi Suomi fr Français he hu it Italiano nl Nederlands nn Nynorsk no Norsk pl Polski pt ro Româna ru sk sl Slovencina|Slovenšcina sv tr Türkçe wa Has anybody any idea where I'd get the rest? Angus
Re: The LANG environment variable...
Angus Leeming wrote: Putting the two dataabses together: bg_BG български ca_ES Català cs_CZ Čeština da_DK Dansk de_DE Deutsch en_US English es_ES Español eu Euskara fi_FI Suomi fr_FR Français he_IL עברית hu_HU Magyar it_IT Italiano nl_NL Nederlands nn_NO Nynorsk no_NO Norsk Bokmål pl_PL Polski pt_PT Português ro_RO Româna ru_RU Русский sk_SK Slovenský sl_SI Slovenščina sv_SE Svenska tr_TR Türkçe wa_BE Walon
Re: The LANG environment variable...
Angus Leeming wrote: Uwe, We have these po files in 1.3.x: bg ca cs da de es eu fi fr he hu it nl nn no pl pt ro ru sk sl sv tr wa and your installer dropdown has these language strings: Dansk|Deutsch|English|Espagñol|Euskara|Français|Italiano| Nederlands|Norsk|Nynorsk|Polski|Româna|Russian|Slovencina| Slovenšcina|Suomi|Türkçe I only used the languages that have enough translated strings listed here: http://www.devel.lyx.org/i18n.php3 Should I really enable all languages? Why 2 Slovencina entries? I could bet that somebody will complain about this. I copied the names from http://en.wikipedia.org/wiki/Slovak_language and http://en.wikipedia.org/wiki/Slovenian_language But to clearify the difference I'll use "Slovenský" instead of "Slovenčina". > bg_BG български > ca_ES Català > cs_CZ Čeština > da_DK Dansk > de_DE Deutsch > en_US English > es_ES Español > eu Euskara > fi_FI Suomi > fr_FR Français > he_IL עברית > hu_HU Magyar > it_IT Italiano > nl_NL Nederlands > nn_NO Nynorsk > no_NO Norsk Bokmål > pl_PL Polski > pt_PT Português > ro_RO Româna > ru_RU Русский > sk_SK Slovenský > sl_SI Slovenščina > sv_SE Svenska > tr_TR Türkçe > wa_BE Walon Thanks for the language names but NSIS don't accept Unicode or kyrillic. Chars in this encoding will appear invisible. This restriction is due to NSIS's support for 98/ME as these OSes can't handle unicode. > eu Euskara eu_EU Euskara thanks and regards Uwe
Re: The LANG environment variable...
Uwe Stöhr wrote: Thanks for the language names but NSIS don't accept Unicode or kyrillic. Chars in this encoding will appear invisible. This restriction is due to NSIS's support for 98/ME as these OSes can't handle unicode. Hmmm. googling on "nsis LOCALE_LANGUAGE_NAME hebrew" pulls up http://cvs.limewire.org/fisheye/viewrep/~raw,r=1.51/limecvs/lib/messagebundles/MessagesBundle_iw.properties googling on "nsis LOCALE_LANGUAGE_NAME czech" pulls up http://cvs.limewire.org/fisheye/viewrep/~raw,r=1.50/limecvs/lib/messagebundles/MessagesBundle_cs.UTF-8.txt It seems that you *can* input non-latin-1 stuff, at least some of the time. Angus
Re: The LANG environment variable...
Angus Leeming wrote: googling on "nsis LOCALE_LANGUAGE_NAME hebrew" pulls up http://cvs.limewire.org/fisheye/viewrep/~raw,r=1.51/limecvs/lib/messagebundles/MessagesBundle_iw.properties Oh this looks complicated and I'm not sure it it's possible to get hebrew, kyrillic, and latin displayed in one page. Another problem: Whenever I checkout CVS I get e.g. version lyx_path_prefix.C in revision 1.3 (08-06) instead of revision 1.1.2.3 (09-06), also If I use the CVS interface from lyx.org. The same is for the other files. What is the right CVS checkout comand to get the actual version? Could you tag new versions as e.g. 1.3.1 instead of 1.1.2.3. It confuses me a bit. regards Uwe
Re: The LANG environment variable...
I wrote: Whenever I checkout CVS I get e.g. version lyx_path_prefix.C in revision 1.3 (08-06) instead of revision 1.1.2.3 (09-06), also If I use the CVS interface from lyx.org. Argh I checked out HEAD insted of the branch! I need a break now. sorry Uwe
Re: The LANG environment variable...
On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: > if "%LANG%"=="" SET LANG=no_NO > lyx.exe %* > [...] > Second line starts the lyx executable and passes any parameters to it. > The script is tested on windows XP. (I don't have lyx for windows, > but the LANG test and parameter passing works fine.) I don't think it works on older Windows versions. I've seen %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume that it can't be a mere oversight of lazy programmers... Andre'
Re: The LANG environment variable...
On Tue, Jun 14, 2005 at 10:45:07AM +0200, Asger Alstrup wrote: > Angus Leeming wrote: > >That way, Uwe wouldn't set LANG globably from the Windows installer but > >rather would get the configure script to output > > > > \ui_language de_DE > > > >to lyxrc.defaults. > > > >Thoughts? > > Looks good to me. I was thinking the same, except that I was leaning > towards a command-line option, but lyxrc will do for me as well. The command line option is 'LANG=de_DE lyx' in a decent shell. SCNR. Andre'
Re: The LANG environment variable...
On Tuesday 14 June 2005 21:34, Andre Poenitz wrote: > On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote: > > if "%LANG%"=="" SET LANG=no_NO > > lyx.exe %* > > [...] > > Second line starts the lyx executable and passes any parameters > > to it. The script is tested on windows XP. (I don't have lyx for > > windows, but the LANG test and parameter passing works fine.) > > I don't think it works on older Windows versions. I've seen > %1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume > that it can't be a mere oversight of lazy programmers... In that case, shouldn't it be lyx.exe "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" ? Angus