Moved implementation of translation class into .cpp file

to make less recompile necessary when changing the implementation.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1421 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2008-01-30 02:24:51 +00:00
parent d0fca1b227
commit 67bf7ddabd
3 changed files with 17 additions and 20 deletions

View File

@ -87,7 +87,7 @@ supertuxkart_SOURCES = main.cpp \
scene.hpp scene.cpp \
race_setup.hpp no_copy.hpp \
constants.hpp \
translation.hpp \
translation.cpp translation.hpp \
traffic.cpp \
player.hpp \
lisp/lisp.cpp lisp/lisp.hpp \

15
src/translation.cpp Executable file
View File

@ -0,0 +1,15 @@
#include "translation.hpp"
initTranslations::initTranslations() {
#ifdef HAS_GETTEXT
// LC_ALL does not work, sscanf will then not always be able
// to scan for example: s=-1.1,-2.3,-3.3 correctly, which is
// used in driveline files.
setlocale (LC_CTYPE, "");
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, "./po");
//bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#endif
}

View File

@ -20,8 +20,6 @@
#ifndef TRANSLATION_H
#define TRANSLATION_H
#undef HAS_GETTEXT
#ifdef HAS_GETTEXT
# include <libintl.h>
# define _(String) gettext(String)
@ -43,24 +41,8 @@
class initTranslations
{
public:
#ifdef HAS_GETTEXT
initTranslations()
{
// textdomain (PACKAGE);
// LC_ALL does not work, sscanf will then not always be able
// to scan for example: s=-1.1,-2.3,-3.3 correctly, which is
// used in driveline files.
setlocale (LC_CTYPE, "");
setlocale (LC_MESSAGES, "");
bindtextdomain (PACKAGE, "/home/joh/local/tuxkart/po");
//bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
}
#else
initTranslations() {}
#endif
initTranslations();
};
#endif
/* EOF */