| 1 |
/* Include file for multi-language support. |
| 2 |
* |
| 3 |
* IRC Services is copyright (c) 1996-2009 Andrew Church. |
| 4 |
* E-mail: <achurch@achurch.org> |
| 5 |
* Parts written by Andrew Kempe and others. |
| 6 |
* This program is free but copyrighted software; see the file GPL.txt for |
| 7 |
* details. |
| 8 |
*/ |
| 9 |
|
| 10 |
#ifndef LANGUAGE_H |
| 11 |
#define LANGUAGE_H |
| 12 |
|
| 13 |
/*************************************************************************/ |
| 14 |
|
| 15 |
/* Languages. Never insert anything in (or delete anything from) the |
| 16 |
* middle of this list, or everybody will start getting the wrong language! |
| 17 |
* If you want to change the order the languages are displayed in for |
| 18 |
* NickServ HELP SET LANGUAGE, do it in language.c. |
| 19 |
*/ |
| 20 |
#define LANG_EN_US 0 /* United States English */ |
| 21 |
#define LANG_UNUSED1 1 /* Unused; was Japanese (JIS encoding) */ |
| 22 |
#define LANG_JA_EUC 2 /* Japanese (EUC encoding) */ |
| 23 |
#define LANG_JA_SJIS 3 /* Japanese (SJIS encoding) */ |
| 24 |
#define LANG_ES 4 /* Spanish */ |
| 25 |
#define LANG_PT 5 /* Portugese */ |
| 26 |
#define LANG_FR 6 /* French */ |
| 27 |
#define LANG_TR 7 /* Turkish */ |
| 28 |
#define LANG_IT 8 /* Italian */ |
| 29 |
#define LANG_DE 9 /* German */ |
| 30 |
#define LANG_NL 10 /* Dutch */ |
| 31 |
#define LANG_HU 11 /* Hungarian */ |
| 32 |
#define LANG_RU 12 /* Russian */ |
| 33 |
|
| 34 |
#define NUM_LANGS 13 /* Number of languages */ |
| 35 |
#define LANG_DEFAULT -1 /* "Use the default" setting */ |
| 36 |
|
| 37 |
/* Sanity-check on default language value */ |
| 38 |
#if DEF_LANGUAGE < 0 || DEF_LANGUAGE >= NUM_LANGS |
| 39 |
# error Invalid value for DEF_LANGUAGE: must be >= 0 and < NUM_LANGS |
| 40 |
#endif |
| 41 |
|
| 42 |
/*************************************************************************/ |
| 43 |
|
| 44 |
/* Flags for maketime() `flags' parameter. */ |
| 45 |
|
| 46 |
#define MT_DUALUNIT 0x0001 /* Allow two units (e.g. X hours Y mins) */ |
| 47 |
#define MT_SECONDS 0x0002 /* Allow seconds (default minutes only) */ |
| 48 |
|
| 49 |
/*************************************************************************/ |
| 50 |
|
| 51 |
/* External symbol declarations (see language.c for documentation). */ |
| 52 |
|
| 53 |
extern int langlist[NUM_LANGS+1]; |
| 54 |
|
| 55 |
extern int lang_init(void); |
| 56 |
extern void lang_cleanup(void); |
| 57 |
extern int load_ext_lang(const char *filename); |
| 58 |
extern void reset_ext_lang(void); |
| 59 |
|
| 60 |
extern int lookup_language(const char *name); |
| 61 |
extern int have_language(int language); |
| 62 |
extern int lookup_string(const char *name); |
| 63 |
extern const char *getstring(const NickGroupInfo *ngi, int index); |
| 64 |
extern const char *getstring_lang(int language, int index); |
| 65 |
extern int setstring(int language, int index, const char *text); |
| 66 |
extern int mapstring(int old, int new); |
| 67 |
extern int addstring(const char *name); |
| 68 |
|
| 69 |
extern int strftime_lang(char *buf, int size, const NickGroupInfo *ngi, |
| 70 |
int format, time_t time); |
| 71 |
extern char *maketime(const NickGroupInfo *ngi, time_t time, int flags); |
| 72 |
extern void expires_in_lang(char *buf, int size, const NickGroupInfo *ngi, |
| 73 |
time_t seconds); |
| 74 |
|
| 75 |
extern void syntax_error(const char *service, const User *u, |
| 76 |
const char *command, int msgnum); |
| 77 |
|
| 78 |
|
| 79 |
/*************************************************************************/ |
| 80 |
|
| 81 |
/* Definitions of language string constants. */ |
| 82 |
#include "langstrs.h" |
| 83 |
|
| 84 |
|
| 85 |
/*************************************************************************/ |
| 86 |
|
| 87 |
#endif /* LANGUAGE_H */ |
| 88 |
|
| 89 |
/* |
| 90 |
* Local variables: |
| 91 |
* c-file-style: "stroustrup" |
| 92 |
* c-file-offsets: ((case-label . *) (statement-case-intro . *)) |
| 93 |
* indent-tabs-mode: nil |
| 94 |
* End: |
| 95 |
* |
| 96 |
* vim: expandtab shiftwidth=4: |
| 97 |
*/ |