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