1 /*
2 * l10n-ja.c -
3 * $Id: l10n-ja.c,v 1.2.4.3 2007-12-05 16:50:47 opengl2772 Exp $
4 *
5 * Copyright (C) 1997-1999 Satoru Takabayashi All rights reserved.
6 * Copyright (C) 2000,2001,2007 Namazu Project All rights reserved.
7 * This is free software with ABSOLUTELY NO WARRANTY.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 * 02111-1307, USA
23 *
24 *
25 */
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #ifdef HAVE_STRING_H
32 # include <string.h>
33 #else
34 # include <strings.h>
35 #endif
36
37 #include "i18n.h"
38 #include "l10n-ja.h"
39
40 /*
41 *
42 * Public functions
43 *
44 */
45
46 /*
47 * FIXME: ad-hoc function.
48 * Currently, it does't work fine if LANG is set "de_DE:ja_JP:C:en".
49 */
50
51 int
nmz_is_lang_ja(void)52 nmz_is_lang_ja(void)
53 {
54 const char *lang;
55
56 lang = nmz_get_lang_ctype();
57 if (!strcmp(lang, "japanese")) {
58 return 1; /* TRUE */
59 }
60 if (!strcmp(lang, "ja")) {
61 return 1; /* TRUE */
62 }
63 if (!strncmp(lang, "ja_JP", 5)) {
64 return 1; /* TRUE */
65 }
66 return 0; /* FALSE */
67 }
68
69