2 * Copyright (C) 2006 Jean Privat
3 * Part of the Neverball Project http://icculus.org/neverball/
5 * NEVERBALL is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; either version 2 of the License,
8 * or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
22 /*---------------------------------------------------------------------------*/
24 void lang_init(const char *domain, const char *default_dir)
27 char *dir = getenv("NEVERBALL_LOCALE");
29 setlocale(LC_ALL, "");
31 bindtextdomain(domain, dir ? dir : default_dir);
32 bind_textdomain_codeset(domain, "UTF-8");
37 const char *sgettext(const char *msgid)
40 const char *msgval = gettext(msgid);
42 const char *msgval = msgid;
47 if ((msgval = strrchr(msgid, '^')))
54 /*---------------------------------------------------------------------------*/