(m17n_object): Be sure to initialize all members.
[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         {"an", "Aragonese"},
51         {"hy", "Armenian"},
52         {"as", "Assamese"},
53         {"ay", "Aymara"},
54         {"az", "Azerbaijani"},
55         {"ba", "Bashkir"},
56         {"eu", "Basque"},
57         {"bn", "Bengali"},              /* Bangla */
58         {"dz", "Bhutani"},
59         {"bh", "Bihari"},
60         {"bi", "Bislama"},
61         {"br", "Breton"},
62         {"bg", "Bulgarian"},
63         {"my", "Burmese"},
64         {"be", "Byelorussian"}, /* Belarusian */
65         {"km", "Cambodian"},    /* Khmer */
66         {"ca", "Catalan"},
67 #if 0
68         {"??", "Cherokee"},
69         {"??", "Chewa"},
70 #endif
71         {"zh", "Chinese"},
72         {"co", "Corsican"},
73         {"hr", "Croatian"},
74         {"cs", "Czech"},
75         {"da", "Danish"},
76         {"dv", "Dhivehi"},
77         {"nl", "Dutch"},
78 #if 0
79         {"??", "Edo"},
80 #endif
81         {"en", "English"},
82         {"eo", "Esperanto"},
83         {"et", "Estonian"},
84         {"fo", "Faeroese"},
85         {"fa", "Farsi"},
86         {"fj", "Fiji"},
87         {"fi", "Finnish"},
88 #if 0
89         {"??", "Flemish"},
90 #endif
91         {"fr", "French"},
92         {"fy", "Frisian"},
93 #if 0
94         {"??", "Fulfulde"},
95 #endif
96         {"gl", "Galician"},
97         {"gd", "Gaelic(Scottish)"},             /* Scottish */
98         {"gv", "Gaelic(Manx)"},         /* Manx */
99         {"ka", "Georgian"},
100         {"de", "German"},
101         {"el", "Greek"},
102         {"kl", "Greenlandic"},
103         {"gn", "Guarani"},
104         {"gu", "Gujarati"},
105         {"ha", "Hausa"},
106 #if 0
107         {"??", "Hawaiian"},
108         {"iw", "Hebrew"},
109 #endif
110         {"he", "Hebrew"},
111         {"hi", "Hindi"},
112         {"hu", "Hungarian"},
113 #if 0
114         {"??", "Ibibio"},
115 #endif
116         {"is", "Icelandic"},
117 #if 0
118         {"??", "Igbo"},
119         {"in", "Indonesian"},
120 #endif
121         {"id", "Indonesian"},
122 #if 0
123         {"ia", "Interlingua"},
124         {"ie", "Interlingue"},
125 #endif
126         {"iu", "Inuktitut"},
127         {"ik", "Inupiak"},
128         {"ga", "Irish"},
129         {"it", "Italian"},
130         {"ja", "Japanese"},
131         {"jw", "Javanese"},
132         {"kn", "Kannada"},
133 #if 0
134         {"??", "Kanuri"},
135 #endif
136         {"ks", "Kashmiri"},
137         {"kk", "Kazakh"},
138         {"rw", "Kinyarwanda"},  /* Ruanda */
139         {"ky", "Kirghiz"},
140         {"rn", "Kirundi"},              /* Rundi */
141         {"ko", "Korean"},
142         {"ku", "Kurdish"},
143         {"lo", "Laothian"},
144         {"la", "Latin"},
145         {"lv", "Latvian"},              /* Lettish */
146         {"ln", "Lingala"},
147         {"lt", "Lithuanian"},
148         {"mk", "Macedonian"},
149         {"mg", "Malagasy"},
150         {"ms", "Malay"},
151         {"ml", "Malayalam"},
152 #if 0
153         {"??", "Manipuri"},
154 #endif
155         {"mt", "Maltese"},
156         {"mi", "Maori"},
157         {"mr", "Marathi"},
158         {"mo", "Moldavian"},
159         {"mn", "Mongolian"},
160         {"na", "Nauru"},
161         {"ne", "Nepali"},
162         {"no", "Norwegian"},
163         {"oc", "Occitan"},
164         {"or", "Oriya"},
165         {"om", "Oromo"},                /* Afan, Galla */
166 #if 0
167         {"??", "Papiamentu"},
168 #endif
169         {"ps", "Pashto"},               /* Pushto */
170         {"pl", "Polish"},
171         {"pt", "Portuguese"},
172         {"pa", "Punjabi"},
173         {"qu", "Quechua"},
174         {"rm", "Rhaeto-Romance"},
175         {"ro", "Romanian"},
176         {"ru", "Russian"},
177 #if 0
178         {"??", "Sami"},         /* Lappish */
179 #endif
180         {"sm", "Samoan"},
181         {"sg", "Sangro"},
182         {"sa", "Sanskrit"},
183         {"sr", "Serbian"},
184         {"sh", "Serbo-Croatian"},
185         {"st", "Sesotho"},
186         {"tn", "Setswana"},
187         {"sn", "Shona"},
188         {"sd", "Sindhi"},
189         {"si", "Sinhalese"},
190         {"ss", "Siswati"},
191         {"sk", "Slovak"},
192         {"sl", "Slovenian"},
193         {"so", "Somali"},
194         {"es", "Spanish"},
195         {"su", "Sundanese"},
196         {"sw", "Swahili"},              /* Kiswahili */
197         {"sv", "Swedish"},
198 #if 0
199         {"??", "Syriac"},
200 #endif
201         {"tl", "Tagalog"},
202         {"tg", "Tajik"},
203 #if 0
204         {"??", "Tamazight"},
205 #endif
206         {"ta", "Tamil"},
207         {"tt", "Tatar"},
208         {"te", "Telugu"},
209         {"th", "Thai"},
210         {"bo", "Tibetan"},
211         {"ti", "Tigrinya"},
212         {"to", "Tonga"},
213         {"ts", "Tsonga"},
214         {"tr", "Turkish"},
215         {"tk", "Turkmen"},
216         {"tw", "Twi"},
217         {"ug", "Uighur"},
218         {"uk", "Ukrainian"},
219         {"ur", "Urdu"},
220         {"uz", "Uzbek"},
221 #if 0
222         {"??", "Venda"},
223 #endif
224         {"vi", "Vietnamese"},
225         {"vo", "Volapuk"},
226         {"cy", "Welsh"},
227         {"wo", "Wolof"},
228         {"xh", "Xhosa"},
229 #if 0
230         {"??", "Yi"},
231         {"ji", "Yiddish"},
232 #endif
233         {"yi", "Yiddish"},
234         {"yo", "Yoruba"},
235         {"zu", "Zulu"} };
236   int i;
237
238   Mlanguage = msymbol ("language");
239   msymbol_put (Mlanguage, Mtext_prop_serializer,
240                (void *) msymbol__serializer);
241   msymbol_put (Mlanguage, Mtext_prop_deserializer,
242                (void *) msymbol__deserializer);
243   for (i = 0; i < ((sizeof lang_rec) / (sizeof lang_rec[0])); i++)
244     msymbol_put (msymbol (lang_rec[i].name), Mlanguage,
245                  msymbol (lang_rec[i].fullname));
246   return 0;
247 }
248
249 void
250 mlang__fini (void)
251 {
252 }
253
254 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */