]> git.vomp.tv Git - vompclient.git/blob - i18n.h
Portability
[vompclient.git] / i18n.h
1 /*
2  * i18n.h: Internationalization
3  *
4  * This code is taken from the VDR project and modified for VOMP.
5  * See the main source file 'vdr.c' for original copyright information.
6  * Modifications (C) 2005 D Pickles.
7
8     This file is part of VOMP.
9
10     VOMP is free software; you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation; either version 2 of the License, or
13     (at your option) any later version.
14
15     VOMP is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18     GNU General Public License for more details.
19
20     You should have received a copy of the GNU General Public License
21     along with VOMP; if not, write to the Free Software
22     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23 */
24
25 #ifndef I18N_H
26 #define I18N_H
27
28 #include <stdio.h>
29 #include <string.h>
30 #ifdef WIN32
31 #include <winsock2.h>
32 #include <shlwapi.h>
33 #endif
34
35 #include "defines.h"
36 #include "log.h"
37 #include "vdr.h"
38
39 #define I18N_HEADER
40 #include "language-data.h"
41 #undef I18N_HEADER
42
43 #define tr(s) I18n::translate(s)
44
45 class I18n
46 {
47   public:
48     static int initialize(void);
49     static char* translate(char* s);
50
51     static const char* LanguageName(int index);
52     static int LanguageIndex(const char* name);
53     static int GetNumLanguages(void);
54
55     const char* const * CharSets(void);
56     const char* const LanguageCode(int Index);
57
58     const static int NumLanguages = NUM_LANGUAGES;
59     const static char* const Languages[];
60
61   private:
62     static int LanguageID;
63     const static char* const charSets[];
64     const static char* const languageCodes[];
65     typedef char* tI18nPhrase[NumLanguages];
66     const static tI18nPhrase Phrases[];
67 };
68
69
70 #endif