vdr
1.7.27
|
00001 /* 00002 * i18n.h: Internationalization 00003 * 00004 * See the main source file 'vdr.c' for copyright information and 00005 * how to reach the author. 00006 * 00007 * $Id: i18n.h 2.1 2012/03/11 14:07:45 kls Exp $ 00008 */ 00009 00010 #ifndef __I18N_H 00011 #define __I18N_H 00012 00013 #include <stdio.h> 00014 #include "tools.h" 00015 00016 #define I18N_DEFAULT_LOCALE "en_US" 00017 #define I18N_MAX_LOCALE_LEN 16 // for buffers that hold en_US etc. 00018 #define I18N_MAX_LANGUAGES 256 // for buffers that hold all available languages 00019 00020 void I18nInitialize(const char *LocaleDir = NULL); 00024 void I18nRegister(const char *Plugin); 00026 void I18nSetLocale(const char *Locale); 00030 int I18nCurrentLanguage(void); 00036 void I18nSetLanguage(int Language); 00039 int I18nNumLanguagesWithLocale(void); 00042 const cStringList *I18nLanguages(void); 00049 const char *I18nTranslate(const char *s, const char *Plugin = NULL) __attribute_format_arg__(1); 00053 const char *I18nLocale(int Language); 00057 const char *I18nLanguageCode(int Language); 00063 int I18nLanguageIndex(const char *Code); 00066 const char *I18nNormalizeLanguageCode(const char *Code); 00070 bool I18nIsPreferredLanguage(int *PreferredLanguages, const char *LanguageCode, int &OldPreference, int *Position = NULL); 00080 00081 #ifdef PLUGIN_NAME_I18N 00082 #define tr(s) I18nTranslate(s, "vdr-" PLUGIN_NAME_I18N) 00083 #define trVDR(s) I18nTranslate(s) // to use a text that's in the VDR core's translation file 00084 #else 00085 #define tr(s) I18nTranslate(s) 00086 #endif 00087 00088 #define trNOOP(s) (s) 00089 00090 #endif //__I18N_H