Back to index

supertuxkart  0.5+dfsg1
translation.cpp
Go to the documentation of this file.
00001 //  $Id: transation.cpp 839 2006-10-24 00:01:56Z hiker $
00002 //
00003 //  SuperTuxKart - a fun racing game with go-kart
00004 //  Copyright (C) 2006, 2007, 2008 Joerg Henrichs
00005 //
00006 //  This program is free software; you can redistribute it and/or
00007 //  modify it under the terms of the GNU General Public License
00008 //  as published by the Free Software Foundation; either version 2
00009 //  of the License, or (at your option) any later version.
00010 //
00011 //  This program is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //  GNU General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU General Public License
00017 //  along with this program; if not, write to the Free Software
00018 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019 
00020 
00021 #include "translation.hpp"
00022 #include "file_manager.hpp"
00023 
00024 Translations* translations=NULL;
00025 
00026 Translations::Translations() { 
00027 #ifdef HAS_GETTEXT
00028     // LC_ALL does not work, sscanf will then not always be able
00029     // to scan for example: s=-1.1,-2.3,-3.3 correctly, which is
00030     // used in driveline files.
00031 #if defined(WIN32) && !defined(__CYGWIN__)
00032     // Windows does not have LC_MESSAGES
00033     setlocale(LC_CTYPE,    "");
00034 #else
00035     setlocale(LC_MESSAGES, "");
00036 #endif
00037     bindtextdomain (PACKAGE, file_manager->getTranslationDir().c_str());
00038     textdomain (PACKAGE);
00039     bind_textdomain_codeset(PACKAGE, "iso-8859-1");
00040 #endif
00041 }   // Translations
00042