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