Cannot change language in Linux version

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
vicza
Posts: 238
Joined: January 16th, 2008, 11:40 pm
Location: Moscow

Cannot change language in Linux version

Post by vicza »

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:

Code: Select all

WARNING: setlocale() failed for 'ru_RU'.
WARNING: setlocale() failed for 'ru_RU'.
But it says the same in the Windows version, but the language still can be changed there.
torangan
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Re: Cannot change language in Linux version

Post by torangan »

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!
User avatar
ivanovic
Lord of Translations
Posts: 1149
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Re: Cannot change language in Linux version

Post by ivanovic »

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.
vicza
Posts: 238
Joined: January 16th, 2008, 11:40 pm
Location: Moscow

Re: Cannot change language in Linux version

Post by vicza »

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:

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
They were putted there during installation, but the program doesn't see them. Why? (The game itself works normally).
User avatar
Iris
Site Administrator
Posts: 6800
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Cannot change language in Linux version

Post by Iris »

vicza wrote:Of course, I have installed it, otherwise how could I run it?
Running it from the source tree:

Code: Select all

$ ./src/wesnoth .
Or anywhere else as long as you call upon the executable with its complete path and you pass the correct working directory to the command line. Line above is equivalent to:

Code: Select all

$ /usr/local/bin/wesnoth /usr/local/share/wesnoth
If Wesnoth was built and installed locally.

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.
caslav.ilic
Translator
Posts: 61
Joined: February 5th, 2007, 4:17 pm
Location: Brunswick, Germany

Re: Cannot change language in Linux version

Post by caslav.ilic »

vicza wrote:[...] Russian files [...] They were putted there during installation, but the program doesn't see them.
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.

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 (Часлав Илић)
vicza
Posts: 238
Joined: January 16th, 2008, 11:40 pm
Location: Moscow

Re: Cannot change language in Linux version

Post by vicza »

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.
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. :hmm:

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. :wink:
caslav.ilic
Translator
Posts: 61
Joined: February 5th, 2007, 4:17 pm
Location: Brunswick, Germany

Re: Cannot change language in Linux version

Post by caslav.ilic »

vicza wrote:But, as I mentioned before, I have the pre-compiled 1.2.8 from a repository, and there language switching works.
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:And now, I've just copied Russian .mo's to the en_GB directory. [...]
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.
Chusslove Illich (Часлав Илић)
torangan
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Re: Cannot change language in Linux version

Post by torangan »

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)
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp

Translators for all languages required: contact me. No geek skills required!
vicza
Posts: 238
Joined: January 16th, 2008, 11:40 pm
Location: Moscow

Re: Cannot change language in Linux version

Post by vicza »

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.
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. :)

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?
torangan wrote:If it works for another locale it's obvious that the fault is with your configuration and not in Wesnoth.
If language files are present, why they can't just be used? In the Windows version it works, regardless any errors with locale setting...
AI
Inactive Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Cannot change language in Linux version

Post by AI »

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. ;)
suitsmeveryfine
Posts: 9
Joined: March 16th, 2008, 10:58 pm
Location: Marseille
Contact:

Re: Cannot change language in Linux version -- Me neither!

Post by suitsmeveryfine »

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.
caslav.ilic
Translator
Posts: 61
Joined: February 5th, 2007, 4:17 pm
Location: Brunswick, Germany

Re: Cannot change language in Linux version

Post by caslav.ilic »

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 (Часлав Илић)
suitsmeveryfine
Posts: 9
Joined: March 16th, 2008, 10:58 pm
Location: Marseille
Contact:

Re: Cannot change language in Linux version

Post by suitsmeveryfine »

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?
caslav.ilic
Translator
Posts: 61
Joined: February 5th, 2007, 4:17 pm
Location: Brunswick, Germany

Re: Cannot change language in Linux version

Post by caslav.ilic »

I would assume it's in terminal, that's where I can see it.

You could try starting Wesnoth with:

Code: Select all

$ LC_ALL=sv_SE.UTF-8 wesnoth
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.
Chusslove Illich (Часлав Илић)
Post Reply