Include <stdio.h>.
[m17n/m17n-lib.git] / src / language.c
1 /* language.c -- language module.
2    Copyright (C) 2003, 2004
3      National Institute of Advanced Industrial Science and Technology (AIST)
4      Registration Number H15PRO112
5
6    This file is part of the m17n library.
7
8    The m17n library is free software; you can redistribute it and/or
9    modify it under the terms of the GNU Lesser General Public License
10    as published by the Free Software Foundation; either version 2.1 of
11    the License, or (at your option) any later version.
12
13    The m17n library is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Lesser General Public License for more details.
17
18    You should have received a copy of the GNU Lesser General Public
19    License along with the m17n library; if not, write to the Free
20    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21    02111-1307, USA.  */
22
23 #include <config.h>
24 #include <stdlib.h>
25 #include "m17n.h"
26 #include "m17n-misc.h"
27 #include "internal.h"
28 #include "language.h"
29 #include "symbol.h"
30
31 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
32
33 \f
34 /* Internal API */
35
36 int
37 mlang__init ()
38 {
39   /* ISO 639 */
40   struct {
41     char *name, *fullname;
42   } lang_rec[] =
43       { {"ab", "Abkhazian"},
44         {"aa", "Afar"},
45         {"af", "Afrikaans"},
46         {"ak", "Akan"},
47         {"sq", "Albanian"},
48         {"am", "Amharic"},
49         {"ar", "Arabic"},
50         {"hy", "Armenian"},
51         {"as", "Assamese"},
52         {"ay", "Aymara"},
53         {"az", "Azerbaijani"},
54         {"ba", "Bashkir"},
55         {"eu", "Basque"},
56         {"bn", "Bengali"},              /* Bangla */
57         {"dz", "Bhutani"},
58         {"bh", "Bihari"},
59         {"bi", "Bislama"},
60         {"br", "Breton"},
61         {"bg", "Bulgarian"},
62         {"my", "Burmese"},
63         {"be", "Byelorussian"}, /* Belarusian */
64         {"km", "Cambodian"},    /* Khmer */
65         {"ca", "Catalan"},
66 #if 0
67         {"??", "Cherokee"},
68         {"??", "Chewa"},
69 #endif
70         {"zh", "Chinese"},
71         {"co", "Corsican"},
72         {"hr", "Croatian"},
73         {"cs", "Czech"},
74         {"da", "Danish"},
75         {"dv", "Dhivehi"},
76         {"nl", "Dutch"},
77 #if 0
78         {"??", "Edo"},
79 #endif
80         {"en", "English"},
81         {"eo", "Esperanto"},
82         {"et", "Estonian"},
83         {"fo", "Faeroese"},
84         {"fa", "Farsi"},
85         {"fj", "Fiji"},
86         {"fi", "Finnish"},
87 #if 0
88         {"??", "Flemish"},
89 #endif
90         {"fr", "French"},
91         {"fy", "Frisian"},
92 #if 0
93         {"??", "Fulfulde"},
94 #endif
95         {"gl", "Galician"},
96         {"gd", "Gaelic(Scottish)"},             /* Scottish */
97         {"gv", "Gaelic(Manx)"},         /* Manx */
98         {"ka", "Georgian"},
99         {"de", "German"},
100         {"el", "Greek"},
101         {"kl", "Greenlandic"},
102         {"gn", "Guarani"},
103         {"gu", "Gujarati"},
104         {"ha", "Hausa"},
105 #if 0
106         {"??", "Hawaiian"},
107         {"iw", "Hebrew"},
108 #endif
109         {"he", "Hebrew"},
110         {"hi", "Hindi"},
111         {"hu", "Hungarian"},
112 #if 0
113         {"??", "Ibibio"},
114 #endif
115         {"is", "Icelandic"},
116 #if 0
117         {"??", "Igbo"},
118         {"in", "Indonesian"},
119 #endif
120         {"id", "Indonesian"},
121 #if 0
122         {"ia", "Interlingua"},
123         {"ie", "Interlingue"},
124 #endif
125         {"iu", "Inuktitut"},
126         {"ik", "Inupiak"},
127         {"ga", "Irish"},
128         {"it", "Italian"},
129         {"ja", "Japanese"},
130         {"jw", "Javanese"},
131         {"kn", "Kannada"},
132 #if 0
133         {"??", "Kanuri"},
134 #endif
135         {"ks", "Kashmiri"},
136         {"kk", "Kazakh"},
137         {"rw", "Kinyarwanda"},  /* Ruanda */
138         {"ky", "Kirghiz"},
139         {"rn", "Kirundi"},              /* Rundi */
140         {"ko", "Korean"},
141         {"ku", "Kurdish"},
142         {"lo", "Laothian"},
143         {"la", "Latin"},
144         {"lv", "Latvian"},              /* Lettish */
145         {"ln", "Lingala"},
146         {"lt", "Lithuanian"},
147         {"mk", "Macedonian"},
148         {"mg", "Malagasy"},
149         {"ms", "Malay"},
150         {"ml", "Malayalam"},
151 #if 0
152         {"??", "Manipuri"},
153 #endif
154         {"mt", "Maltese"},
155         {"mi", "Maori"},
156         {"mr", "Marathi"},
157         {"mo", "Moldavian"},
158         {"mn", "Mongolian"},
159         {"na", "Nauru"},
160         {"ne", "Nepali"},
161         {"no", "Norwegian"},
162         {"oc", "Occitan"},
163         {"or", "Oriya"},
164         {"om", "Oromo"},                /* Afan, Galla */
165 #if 0
166         {"??", "Papiamentu"},
167 #endif
168         {"ps", "Pashto"},               /* Pushto */
169         {"pl", "Polish"},
170         {"pt", "Portuguese"},
171         {"pa", "Punjabi"},
172         {"qu", "Quechua"},
173         {"rm", "Rhaeto-Romance"},
174         {"ro", "Romanian"},
175         {"ru", "Russian"},
176 #if 0
177         {"??", "Sami"},         /* Lappish */
178 #endif
179         {"sm", "Samoan"},
180         {"sg", "Sangro"},
181         {"sa", "Sanskrit"},
182         {"sr", "Serbian"},
183         {"sh", "Serbo-Croatian"},
184         {"st", "Sesotho"},
185         {"tn", "Setswana"},
186         {"sn", "Shona"},
187         {"sd", "Sindhi"},
188         {"si", "Sinhalese"},
189         {"ss", "Siswati"},
190         {"sk", "Slovak"},
191         {"sl", "Slovenian"},
192         {"so", "Somali"},
193         {"es", "Spanish"},
194         {"su", "Sundanese"},
195         {"sw", "Swahili"},              /* Kiswahili */
196         {"sv", "Swedish"},
197 #if 0
198         {"??", "Syriac"},
199 #endif
200         {"tl", "Tagalog"},
201         {"tg", "Tajik"},
202 #if 0
203         {"??", "Tamazight"},
204 #endif
205         {"ta", "Tamil"},
206         {"tt", "Tatar"},
207         {"te", "Telugu"},
208         {"th", "Thai"},
209         {"bo", "Tibetan"},
210         {"ti", "Tigrinya"},
211         {"to", "Tonga"},
212         {"ts", "Tsonga"},
213         {"tr", "Turkish"},
214         {"tk", "Turkmen"},
215         {"tw", "Twi"},
216         {"ug", "Uighur"},
217         {"uk", "Ukrainian"},
218         {"ur", "Urdu"},
219         {"uz", "Uzbek"},
220 #if 0
221         {"??", "Venda"},
222 #endif
223         {"vi", "Vietnamese"},
224         {"vo", "Volapuk"},
225         {"cy", "Welsh"},
226         {"wo", "Wolof"},
227         {"xh", "Xhosa"},
228 #if 0
229         {"??", "Yi"},
230         {"ji", "Yiddish"},
231 #endif
232         {"yi", "Yiddish"},
233         {"yo", "Yoruba"},
234         {"zu", "Zulu"} };
235   int i;
236
237   Mlanguage = msymbol ("language");
238   msymbol_put (Mlanguage, Mtext_prop_serializer,
239                (void *) msymbol__serializer);
240   msymbol_put (Mlanguage, Mtext_prop_deserializer,
241                (void *) msymbol__deserializer);
242   for (i = 0; i < ((sizeof lang_rec) / (sizeof lang_rec[0])); i++)
243     msymbol_put (msymbol (lang_rec[i].name), Mlanguage,
244                  msymbol (lang_rec[i].fullname));
245   return 0;
246 }
247
248 void
249 mlang__fini (void)
250 {
251 }
252
253 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */