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:
parent
d0fca1b227
commit
67bf7ddabd
@ -87,7 +87,7 @@ supertuxkart_SOURCES = main.cpp \
|
|||||||
scene.hpp scene.cpp \
|
scene.hpp scene.cpp \
|
||||||
race_setup.hpp no_copy.hpp \
|
race_setup.hpp no_copy.hpp \
|
||||||
constants.hpp \
|
constants.hpp \
|
||||||
translation.hpp \
|
translation.cpp translation.hpp \
|
||||||
traffic.cpp \
|
traffic.cpp \
|
||||||
player.hpp \
|
player.hpp \
|
||||||
lisp/lisp.cpp lisp/lisp.hpp \
|
lisp/lisp.cpp lisp/lisp.hpp \
|
||||||
|
15
src/translation.cpp
Executable file
15
src/translation.cpp
Executable 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
|
||||||
|
}
|
||||||
|
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef TRANSLATION_H
|
#ifndef TRANSLATION_H
|
||||||
#define TRANSLATION_H
|
#define TRANSLATION_H
|
||||||
|
|
||||||
#undef HAS_GETTEXT
|
|
||||||
|
|
||||||
#ifdef HAS_GETTEXT
|
#ifdef HAS_GETTEXT
|
||||||
# include <libintl.h>
|
# include <libintl.h>
|
||||||
# define _(String) gettext(String)
|
# define _(String) gettext(String)
|
||||||
@ -43,24 +41,8 @@
|
|||||||
class initTranslations
|
class initTranslations
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#ifdef HAS_GETTEXT
|
initTranslations();
|
||||||
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
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user