Re: [Tuxpaint-devel] *SDL2* translation does not work on the latest MinGW/MSYS2
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Pere P. i C. <per...@gm...> - 2022-01-30 19:28:22
|
El dg. 30 de 01 de 2022 a les 17:23 +0100, en/na Pere Pujal i Carabantes va escriure: > El dg. 30 de 01 de 2022 a les 22:18 +0900, en/na Shin-ichi TOYAMA va escriure: > > Hi! > > > > I tried a test code as follows. > > > > $ cat test.c > > #include <stdio.h> > > #include <libintl.h> > > > > int main(void) > > { > > setlocale(LC_ALL, ""); > > bindtextdomain("tuxpaint", "locale"); > > bind_textdomain_codeset("tuxpaint", "UTF-8"); > > textdomain("tuxpaint"); > > puts(gettext("Yes, I'm done!")); > > return 0; > > } > > > > $ gcc test.c -o test.exe -lintl > > > > I copied this .exe file to the bdist directory and executed it from > > windows command prompt. > > > > Then, it DOES translate. > > > > I am quite at a loss what is happening.... > > Some progress, when in i18n.c in the bindtextdomain function I set the full path in the windows way,E:\\home\\tuxpaint-sdl2\\win32\\bdist\\locale\\ then it works with the updated mingw > > maybe LOCALEDIR that now is locale/ should be changed to locale\\ or maybe just to locale as you say it works in your test After some more tests with bindtextdomain, I couldn't make it working with any of the combinations of the locale string I tested, maybe you could have more luck. What works for me is to use the full path, copying/adapting some code from chdir_to_binary from tuxpaint.c and get_fname from fname.c: char curdir[256]; char f[512]; getcwd(curdir, sizeof(curdir)); #ifdef DEBUG printf("Current directory at launchtime: %s\n", curdir); #endif snprintf(f, sizeof(f), "%s%s", curdir, "\\\\locale\\\\"); bindtextdomain("tuxpaint", f); > > HTH > Pere > > > > > > On Sun, 30 Jan 2022 00:31:53 +0100, Pere Pujal i Carabantes wrote: > > > El ds. 29 de 01 de 2022 a les 10:31 +0900, en/na Shin-ichi TOYAMA va escriure: > > > > Hi! > > > > > > > > I noticed an interesting thing about this issue. > > > > > > > > You can install tuxpaint in /usr/local/bin on MSYS2 environment > > > > as follows. > > > > > > > > $ make && make install > > > > > > I get permission denied, strange > > > /usr/local/bin/tuxpaint.exe --help > > > bash: /usr/local/bin/tuxpaint.exe: Permission denied > > > > > > > > > > > Then it has NO problem with translation!! > > > > > > > > Next, I tried deleting all the .dll files in /mingw64/bin/ except > > > > for those are copied to the win32/bdist directory, suspecting that > > > > there might be some dll(s) newly required by gettext. > > > > > > > > As a result, it still worked fine! > > > > > > > > Considering above, it may not be a library loading issue. > > > > > > I did a different test that seems to lead also to this conclusion: > > > compile a bdist dir with the old mingw, make a backup of it > > > compile another bdist with the new mingw, also backup it > > > create an empty dir and copy there the backup of the non working bdist, > > > then one by one copy the dlls of the working bdist into it > > > until the translations works. > > > > > > the least dlls that I had to copy from the old, working bdist dir are > > > libintl and harfbuzz(wich depends on libintl) > > > > > > > > > > > Could it be that tuxpaint fails to find the translation (.mo) files ? > > > > > > Maybe, but even putting the full locale path in i18n.c I could not get it working > > > > > > Replacing bindtextdomain("tuxpaint", LOCALEDIR); with > > > bindtextdomain("tuxpaint", "/e/home/tuxpaint-sdl2/win32/bdist/locale/"); > > > did not solve things for me. > > > > > > _______________________________________________ > > Tuxpaint-devel mailing list > > Tux...@li... > > https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel > |