Localization bug with dates in load game screen

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

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:

Localization bug with dates in load game screen

Postby GunChleoc » October 13th, 2012, 6:22 pm

Wesnoth can't handle my operating system's locale (gd) in the load game screen and displays English instead.

OS: Windows 7
Game version: 1.10.4
Game Language: Scottish Gaelic (gd)

Walkthrough: Choose "Gàidhlig" in the Languages menu, then go on "Luchdaich" (Load). You might need to get the language files first.

My proposed solution: Add translation of month and weekdays names to the PO files.

I'll add a screenshot.

There is also a discussion in the ideas forum here where someone suggested I create a bug report.
Attachments
wesnoth-localization-date-b.png
User avatar
GunChleoc
Translator
 
Posts: 206
Joined: September 28th, 2012, 7:35 am

Re: Localization bug with dates in load game screen

Postby ivanovic » October 26th, 2012, 11:27 am

Sorry to tell you, but on my Linux box I get this stuff translated automatically. No idea why this is not working for Windows. Yes, the strings for the date and stuff like this depend only on the OS. Yes, the days and month there are not part of the changeable strings at all. The dates are there as some system function.
User avatar
ivanovic
Lord of Translations
 
Posts: 1146
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Re: Localization bug with dates in load game screen

Postby GunChleoc » October 26th, 2012, 2:11 pm

The location in your forum profile is Germany, so I guess you have German as your locale. It works fine in Windows if I select German as the game language. The issue here isn't Linux vs. Windows, it's majority languages vs. minority languages.

It doesn't take a lot of code to localise month names. E.g. in PHP it looks something like this:

Code: Select all
function formatdatetime($date,$short=false)
{
   $result ="";
     if(!$short)
     {
       $format=getproperty("Date Time Format");
        $result= @date($format,strtotime($date));
        $result= str_replace("January",getlangarray("date_month",1),$result);
        $result= str_replace("February",getlangarray("date_month",2),$result);
        $result= str_replace("March",getlangarray("date_month",3),$result);
        $result= str_replace("April",getlangarray("date_month",4),$result);
        $result= str_replace("May",getlangarray("date_month",5),$result);
        $result= str_replace("June",getlangarray("date_month",6),$result);
        $result= str_replace("July",getlangarray("date_month",7),$result);
        $result= str_replace("August",getlangarray("date_month",8),$result);
        $result= str_replace("September",getlangarray("date_month",9),$result);
        $result= str_replace("October",getlangarray("date_month",10),$result);
        $result= str_replace("November",getlangarray("date_month",11),$result);
        $result= str_replace("December",getlangarray("date_month",12),$result);
     }
     else
     {
       $format=SHORTDATETIMEFORMAT;
       $result= @date($format,strtotime($date));
     }
     return str_replace(" "," ",$result);;
}

Plus you could use the same method for short month names, days of the week etc. This works fine for the Roman calendar at least.

I haven't managed to compile Wesnoth so far, so I can't implement this myself. I also don't speak C++ yet.
User avatar
GunChleoc
Translator
 
Posts: 206
Joined: September 28th, 2012, 7:35 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest