Cannot change language in Linux version
Moderator: Forum Moderators
Forum rules
Before reporting issues in this section, you must read the following topic:
Before reporting issues in this section, you must read the following topic:
Cannot change language in Linux version
To date, I have compiled in Linux (kubu 7.10) versions 1.3.7 and 1.4+svn. In separate directories, certainly. Both work fine, except for one thing: I can't change the language. My system locale is English, and that is the language of the game. I click Language, select Russian (or anything else) -- and nothing changes. The language's still English. Why?
In console it says nothing, except for:
But it says the same in the Windows version, but the language still can be changed there.
In console it says nothing, except for:
Code: Select all
WARNING: setlocale() failed for 'ru_RU'.
WARNING: setlocale() failed for 'ru_RU'.
Re: Cannot change language in Linux version
Try to install, problems fetching the translations out of the src directory aren't uncommon.
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp
Translators for all languages required: contact me. No geek skills required!
http://www.wesnoth.org/wiki/WesCamp
Translators for all languages required: contact me. No geek skills required!
Re: Cannot change language in Linux version
Do you have the glibc locale for russian installed? Under linux it is mandatory to have this available so that translations do work. There is a workaround, but this one is a dirty hack which might create more and different problems:
At configure time use the switch --enable-dummy-locales.
Beside this:
Often there are problems regarding translations when not running make install. So make sure to install the game, too. But your problems basically sounds like the locale ru_RU not being installed systemwide. I don't know how to do so for your distribution, probably you will have to search the "official docs" of it for this stuff.
At configure time use the switch --enable-dummy-locales.
Beside this:
Often there are problems regarding translations when not running make install. So make sure to install the game, too. But your problems basically sounds like the locale ru_RU not being installed systemwide. I don't know how to do so for your distribution, probably you will have to search the "official docs" of it for this stuff.
Re: Cannot change language in Linux version
Of course, I have installed it, otherwise how could I run it?
And I have the Russian locale on my machine, only don't want to switch to it (I prefer to have English as a system language). Besides, I have 1.2.8 from repository, and there language switching works. It doesn't work in compiled versions. For example, for svn version the Russian files are here:
They were putted there during installation, but the program doesn't see them. Why? (The game itself works normally).
And I have the Russian locale on my machine, only don't want to switch to it (I prefer to have English as a system language). Besides, I have 1.2.8 from repository, and there language switching works. It doesn't work in compiled versions. For example, for svn version the Russian files are here:
Code: Select all
vicza@namai:/opt/games/wesnoth-svn/share/wesnoth-svn/translations/ru/LC_MESSAGES$ ls -l
total 1844
-rw-r--r-- 1 root root 28112 2008-03-17 10:36 wesnoth-aoi.mo
-rw-r--r-- 1 root root 84941 2008-03-17 10:36 wesnoth-did.mo
-rw-r--r-- 1 root root 3671 2008-03-17 10:36 wesnoth-editor.mo
-rw-r--r-- 1 root root 78797 2008-03-17 10:36 wesnoth-ei.mo
-rw-r--r-- 1 root root 293350 2008-03-17 10:36 wesnoth-httt.mo
-rw-r--r-- 1 root root 24771 2008-03-17 10:36 wesnoth-lib.mo
-rw-r--r-- 1 root root 3260 2008-03-17 10:36 wesnoth-l.mo
-rw-r--r-- 1 root root 355472 2008-03-17 10:36 wesnoth.mo
-rw-r--r-- 1 root root 48015 2008-03-17 10:36 wesnoth-multiplayer.mo
-rw-r--r-- 1 root root 1290 2008-03-17 10:36 wesnoth-nr.mo
-rw-r--r-- 1 root root 54652 2008-03-17 10:36 wesnoth-sof.mo
-rw-r--r-- 1 root root 32759 2008-03-17 10:36 wesnoth-sotbe.mo
-rw-r--r-- 1 root root 19851 2008-03-17 10:36 wesnoth-tb.mo
-rw-r--r-- 1 root root 504 2008-03-17 10:36 wesnoth-thot.mo
-rw-r--r-- 1 root root 164801 2008-03-17 10:36 wesnoth-trow.mo
-rw-r--r-- 1 root root 136554 2008-03-17 10:36 wesnoth-tsg.mo
-rw-r--r-- 1 root root 60276 2008-03-17 10:36 wesnoth-tutorial.mo
-rw-r--r-- 1 root root 225130 2008-03-17 10:36 wesnoth-units.mo
-rw-r--r-- 1 root root 200103 2008-03-17 10:36 wesnoth-utbs.mo
Re: Cannot change language in Linux version
Running it from the source tree:vicza wrote:Of course, I have installed it, otherwise how could I run it?
Code: Select all
$ ./src/wesnoth .
Code: Select all
$ /usr/local/bin/wesnoth /usr/local/share/wesnoth
This is just for general information, not related to your issue. I thought it ought to be clarified, since the emphasis you put in your statement.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
-
- Translator
- Posts: 61
- Joined: February 5th, 2007, 4:17 pm
- Location: Brunswick, Germany
Re: Cannot change language in Linux version
The problem is most certainly not due to translation catalogs themselves, but due to system locale. It tells you it cannot set ru_RU, so you probably don't, like, really have such locale installed. You can see installed locales executing locale -a.vicza wrote:[...] Russian files [...] They were putted there during installation, but the program doesn't see them.
Having said this, when compared to usual Gettext-localized apps, Wesnoth behaves a tad bit strangely. To be able to run an app in a certain language, normally it is only necessary to a) have any existing locale set up through LANG/LC_ALL (other than POSIX and C) b) set LANGUAGE to desired language (which an app can also do internally upon menu choice). I wonder why Wesnoth does what it does, insiting on setting a locale itself?
Chusslove Illich (Часлав Илић)
Re: Cannot change language in Linux version
Hmmm, indeed, I don't have any locale except for a lot English ones. But, as I mentioned before, I have the pre-compiled 1.2.8 from a repository, and there language switching works.caslav.ilic wrote:The problem is most certainly not due to translation catalogs themselves, but due to system locale. It tells you it cannot set ru_RU, so you probably don't, like, really have such locale installed. You can see installed locales executing locale -a.

Maybe, I should indeed use the "--enable-dummy-locales" key while configuring.
And now, I've just copied Russian .mo's to the en_GB directory. With that locale it works.

-
- Translator
- Posts: 61
- Joined: February 5th, 2007, 4:17 pm
- Location: Brunswick, Germany
Re: Cannot change language in Linux version
Maybe Ubuntu packagers were patching a bit? I've same no-locale-no-language behavior from my distro-packaged 1.2.8 on Debian.vicza wrote:But, as I mentioned before, I have the pre-compiled 1.2.8 from a repository, and there language switching works.
Wouldn't be easier if you installed ru_RU too? :) It's only running sudo dpkg-reconfigure locales and selecting (probably best) ru_RU.UTF-8. Note that this by itself will just add few kilobytes of locale data, it won't switch your language in apps or something like that.vicza wrote:And now, I've just copied Russian .mo's to the en_GB directory. [...]
Chusslove Illich (Часлав Илић)
Re: Cannot change language in Linux version
If it works for another locale it's obvious that the fault is with your configuration and not in Wesnoth. You've got to install the locale so Wesnoth can select it at runtime to have all the string functions do the right thing. I'm not sure what trick the official packages use, maybe they use dummy locales which are quite a hack...
As said, adding a few more locales won't hurt. Until recently it was common to have all of them installed which wasted quite a bit of space as there are hundreds. But those for the languages you use should all be installed in their different encoding variants. (e.g. +/- UTF8)
As said, adding a few more locales won't hurt. Until recently it was common to have all of them installed which wasted quite a bit of space as there are hundreds. But those for the languages you use should all be installed in their different encoding variants. (e.g. +/- UTF8)
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp
Translators for all languages required: contact me. No geek skills required!
http://www.wesnoth.org/wiki/WesCamp
Translators for all languages required: contact me. No geek skills required!
Re: Cannot change language in Linux version
As we say here, in Russia: "Работает -- не трогай" ("It works? -- don't touch it"). Having some experience with Linux (though that was about a year ago) I think it's quite a good approach.caslav.ilic wrote:Wouldn't be easier if you installed ru_RU too?It's only running sudo dpkg-reconfigure locales and selecting (probably best) ru_RU.UTF-8. Note that this by itself will just add few kilobytes of locale data, it won't switch your language in apps or something like that.

BTW, I've noticed just now, when the game runs in the full-screen, you can't switch to any other application using Alt-Tab. Is that normal?
If language files are present, why they can't just be used? In the Windows version it works, regardless any errors with locale setting...torangan wrote:If it works for another locale it's obvious that the fault is with your configuration and not in Wesnoth.
Re: Cannot change language in Linux version
More things than just wesnoth have that unfortunately, but at least in wesnoth you can use ctrl-f to get out of fullscreen quickly.
As for the language files, that is just how gettext works, or how wesnoth works with gettext. It's all very complicated.
As for the language files, that is just how gettext works, or how wesnoth works with gettext. It's all very complicated.

-
- Posts: 9
- Joined: March 16th, 2008, 10:58 pm
- Location: Marseille
- Contact:
Re: Cannot change language in Linux version -- Me neither!
Neither I can change the language (in my case from English into Swedish) and just as for vicza I do have the locales installed, sv_SE.utf-8 more precisely. I compiled v. 1.14 in Ubuntu v. 7.10. Previously I played the 1.2 version of Wesnoth and then I had no problem in changing to any language, even into languages that I don't have got the locales for.
-
- Translator
- Posts: 61
- Joined: February 5th, 2007, 4:17 pm
- Location: Brunswick, Germany
Re: Cannot change language in Linux version
Now that's bloody odd, for when I install sv_SE.UTF-8, I do get Swedish on request :) What about those same warnings that Vicza reporter in the first post? What are the LANG and LC_ALL variables set to?
Chusslove Illich (Часлав Илић)
-
- Posts: 9
- Joined: March 16th, 2008, 10:58 pm
- Location: Marseille
- Contact:
Re: Cannot change language in Linux version
I don't know; I don't understand in what console he sees that information. When he runs the game in the terminal or what?
-
- Translator
- Posts: 61
- Joined: February 5th, 2007, 4:17 pm
- Location: Brunswick, Germany
Re: Cannot change language in Linux version
I would assume it's in terminal, that's where I can see it.
You could try starting Wesnoth with:
If it gives you the translation (in-game selected language should be either Swedish of System Default), then there's probably a problem with the setting of LANG/LC_ALL. If it doesn't, then it's beyond me.
You could try starting Wesnoth with:
Code: Select all
$ LC_ALL=sv_SE.UTF-8 wesnoth
Chusslove Illich (Часлав Илић)