Forums

Full Version: Is the multilanguage support working?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

Sorry if this has being asked before, but I could not find it:
Is the option to change language still working? Here I can change it, but the menus are still always in English.
Which version are you running?
Latest git (last commit = d033dfe022891619b07c2b66ff2a3a741fce9ef5, url = https://github.com/VDrift/vdrift.git ),
and svn revision 1275 ( from http://svn.code.sf.net/p/vdrift/code).
I'm in fedora 20, with bullet 2.81 and getText 0.18.3.2

I tried to uninstall it and install again and to remove my .vdrift directory, but the problem persist, anyway, if it's working for you then its almost sure that was me who messed it up somehow.
Scons script is missing code to generate mo files and install them, since we switched to gettext. It is a low priority task atm, help is welcomed.
Thanks for the info NaN.

How did you generated the pot file at that time? If I'm not mistaken scons can generate it too, would that be necessary?
I can take a look at this but I don't have any experience with Scons, getText or Python hehe As a workaround by now, could not the translators themselves send the .mo files? They are not difficult to generate, poedit for example create them automatically.
Yes, you can generate them manually. That is what I've been doing until now.

Using Poedit or "msgfmt -c -o de.mo de.po" and putting them into locale/de/LC_MESSAGES/vdrift.mo

It would of course be more optimal to integrate it into scons ( http://www.scons.org/doc/2.3.0/HTML/scon...x3534.html ).

data/locale/genpot.py can be used to generate the pot file. It is a remainder from the previous custom localization system (which I am almost missing now, as it has been stupid simple, no messing with gettext or scons).

I think the same could be done with xgettext + custom keyword specifications, haven't bothered to look it up yet.
Another minor issue is that scons install is halfway broken atm. It will just copy all data, ignoring SConscripts in subdirectories. I assume this was hacked into place to reduce script maintenance at some point.


Current idea is to use something like this (in the data/locale/SConscript):
Code:
languages = [os.path.basename(po)[0:-3] for po in src if po.endswith('.po')]
for lang in languages:
    mo_file = lang + '/LC_MESSAGES/vdrift.mo'
    po_file = lang + ".po"
    po_src_file = env.File(po_file).srcnode()
    tgt = env.MoBuild(mo_file, po_src_file)
    inst_tgt = env.InstallAs(os.path.join(env.subst('$destdir$localedir'), mo_file), tgt)
    env.Alias("install", inst_tgt)
@brian_ch I've pushed some code for mo creation when running scons install.
Thanks a lot NaN! I tested here and it's working as expected, the only downside (I think that it's due to gettext) is that I can only use a language if I have the locale for it installed.
gettext should work independently of the locales installed on your operating system. So, the problem must be somewhere else.

Unless you mean the data/locale/<ISO-code>/LC_MESSAGES directory. So, if we have moved on to using .mo files (I'm still downloading the latest test version, so I haven't had a look yet), you will need to add a directory for your locale there and drop the .mo file and rename it to vdrift.mo.

If you only have a .po file, you can use Virtaal or Poedit to create an .mo file without the need to use the gettext command line commands.

ETA: I did all that, but changing the dispay language to gd does nothing - everything remains in English. My computer's locale is set to Scottish Gaelic, so that's not it. System: Windows 7, 64 bit, with vdrift-test-2014-06-23 vdrift_d_vbo.exe.
The test build was meant to test graphics code changes, so I didn't think to include the mo files (in data/locale).
I created the .mo file myself, but it's still not working. I also tested \data\locale\de\LC_MESSAGES\vdrift.mo, which is included in the download - no joy. The proper language code is written into the config file, but the GUI stays in English.
Hmm, I can only select English or German, and I've only used this two settings to test the code. Selecting Gaelic or for example Russian will set German(system default) locale. I guess I am doing something wrong, no idea what though. I will add this to the issue tracker.
For me was the same, but with English and Brazilian Portuguese, after I switched my system language to Russian the game started to show Russian too. The weird is that I tried it now after switching back to Portuguese and Russian is not working anymore.
I think the best way to approach the issue will be, to test supported locales/languages at start, and only list the available ones in the language selection. Current code just scans for po files, which is wrong anyway.

We could also drop the selection altogether, and go for system default maybe. It would make testing translations less convenient though (need to change current system locale).



Looking at gettext docs it seems that locale selection is not trivial:
http://www.gnu.org/software/libc/manual/...tware.html

Also:
http://www.heiner-eichmann.de/autotools/...ttext.html
Pages: 1 2