Adonthell  0.4
nls.h
Go to the documentation of this file.
1 /*
2  $Id: nls.h,v 1.2 2002/04/13 14:51:20 ksterker Exp $
3 
4  Copyright (C) 2002 Kai Sterker <kaisterker@linuxgames.com>
5  Part of the Adonthell Project http://adonthell.linuxgames.com
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file nls.h
17  *
18  * @author Kai Sterker
19  * @brief National Language Support
20  */
21 
22 #ifndef __NLS_H__
23 #define __NLS_H__
24 
25 #include "prefs.h"
26 
27 #ifndef SWIG
28 using std::string;
29 #endif
30 
31 /**
32  * Provides various services for i18n and l10n.
33  */
34 class nls
35 {
36 public:
37  /**
38  * Initialize national language support.
39  * @param myconfig The Engine's configuration
40  */
41  static void init (config &myconfig);
42 
43  /**
44  * Set or change the language to use. Setting the language will
45  * never fail, but only if there is a binary message catalogue
46  * in <gamedir>/po/<country code>LC_MESSAGES/ named <gamename>.mo
47  * the desired language will be actually used.
48  * @param language The country code of the desired language.
49  */
50  static void set_language (const string &language);
51 
52  /**
53  * Translate the given string if it's found in the message
54  * catalogue. This is just a wrapper around the GNU gettext
55  * function for older versions of Python.
56  * @param text The text to translate
57  * @return either the translated text, or the given text if
58  * no translation was found.
59  */
60  static const char* translate (const string &text);
61 };
62 
63 #endif // __NLS_H__
Adonthell&#39;s configuration.
static void init(config &myconfig)
Initialize national language support.
Definition: nls.cc:31
static void set_language(const string &language)
Set or change the language to use.
Definition: nls.cc:53
static const char * translate(const string &text)
Translate the given string if it&#39;s found in the message catalogue.
Definition: nls.cc:73
Provides various services for i18n and l10n.
Definition: nls.h:34
This class contains the engine&#39;s configuration read either from the config file or from the command l...
Definition: prefs.h:70