Release candidate for 0.0.28 translations

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Release candidate for 0.0.28 translations

Post by Crush » 27 Jan 2009, 02:17

This is a windows installer for 0.0.28 with translations enabled. Please try it out and report if the translation into your language works.

http://www.crushnet.org/tmw/tmw-0.0.28- ... ations.exe

The supported languages are: ar, ca, cs, da, de, en_GB, eo, es, fi, fr, he, hr, id, it, ja, nl, pl, pt, pt_BR, ru, sk, sv, th. Note that some translations are incomplete.

Sourcecode changes:

Code: Select all

iff --git a/packaging/windows/setup.nsi b/packaging/windows/setup.nsi
index ec57051..55b3bd4 100644
--- a/packaging/windows/setup.nsi
+++ b/packaging/windows/setup.nsi
@@ -156,6 +156,7 @@ Section "Core files (required)" SecCore
   CreateDirectory "$INSTDIR\data\graphics\gui"
   CreateDirectory "$INSTDIR\data\graphics\images"
   CreateDirectory "$INSTDIR\docs"
+  CreateDirectory "$INSTDIR\translations"
 
   SetOverwrite ifnewer
   SetOutPath "$INSTDIR"
@@ -180,6 +181,8 @@ Section "Core files (required)" SecCore
   File /nonfatal "${SRCDIR}\data\music\*.ogg"
   SetOutPath "$INSTDIR\docs"
   File "${SRCDIR}\docs\FAQ.txt"
+  SetOutPath "$INSTDIR\"
+  File /nonfatal /r "${SRCDIR}\translations"
 SectionEnd
 
 Section -AdditionalIcons
diff --git a/src/main.cpp b/src/main.cpp
index 0291fd8..13bf147 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -670,11 +670,14 @@ int main(int argc, char *argv[])
     }
 
 #if ENABLE_NLS
+        setlocale(LC_MESSAGES, "");
 #ifdef WIN32
         putenv(("LANG=" + std::string(_nl_locale_name_default())).c_str());
-#endif
-        setlocale(LC_MESSAGES, "");
+        // mingw doesn't like LOCALEDIR to be defined for some reason
+        bindtextdomain("tmw", "translations/");
+#else
         bindtextdomain("tmw", LOCALEDIR);
+#endif
         bind_textdomain_codeset("tmw", "UTF-8");
         textdomain("tmw");
 #endif
Perl script used to create the translations:

Code: Select all

# run this perl script in /packaging/windows


# read translations
open(LANGFILE, "../../po/LINGUAS");

while (defined(my $i = <LANGFILE>))
{
	# ignore comments
	if ($i =~ m/#/) { next };
	# remove linebreaks
	$i =~ s/\n//;
	$i =~ s/\r//;
	#create the output directory
	system("md ..\\..\\translations\\".$i."\\LC_MESSAGES");
	# build the translate command
	my $in = "../../po/" .$i.".po";
	my $out = "../../translations/".$i."/LC_MESSAGES/tmw.mo";
	my $command = "msgfmt -c -o ".$out." ".$in;
	# execute translate command
	system($command);
}
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Re: Release candidate for 0.0.28 translations

Post by Crush » 28 Jan 2009, 17:42

According to my webserver logs only one person has completely downloaded this file so far.

Can someone take a look at it, please?

I won't push the modifications before someone confirmed that it works with at least one other language besides German.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
EJlol
Developer
Developer
Posts: 1072
Joined: 06 Sep 2005, 09:42

Re: Release candidate for 0.0.28 translations

Post by EJlol » 28 Jan 2009, 18:48

Seems to work with dutch. BTW, is it also possible to play in english again? dutch games just sucks.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Re: Release candidate for 0.0.28 translations

Post by Crush » 28 Jan 2009, 20:11

Yes, rename or delete the "translations" folder.

I tried a few things to make gettext select a different language but whatever I tried gettext still used my system language.

I think I should make the translations an optional component when installing TMW so that the user can opt to use tmw without.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
Habari
Novice
Novice
Posts: 249
Joined: 25 Nov 2007, 17:04

Re: Release candidate for 0.0.28 translations

Post by Habari » 31 Jan 2009, 17:36

IN Spanish it works brilliantly well :lol: , 10 points
however only some bits are translated , i do remember , translating everything in launchpad :roll:
by the way how does the PC know im Spanish , i feel spied :shock: :lol:
Anyway IMHO it is pretty weird to play TMW in a language different from english , even if the translation is correct it just feels strange :roll:
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Re: Release candidate for 0.0.28 translations

Post by Crush » 31 Jan 2009, 18:17

The client gets your language setting from windows.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
Post Reply