1
# Miro - an RSS based video player application
2
# Copyright (C) 2005-2010 Participatory Culture Foundation
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
# In addition, as a special exception, the copyright holders give
19
# permission to link the code of portions of this program with the OpenSSL
22
# You must obey the GNU General Public License in all respects for all of
23
# the code used other than OpenSSL. If you modify file(s) with this
24
# exception, you may extend this exception to your version of the file(s),
25
# but you are not obligated to do so. If you do not wish to do so, delete
26
# this exception statement from your version. If you delete this exception
27
# statement from all source files in the program, then also delete it here.
29
def map_to_two_letters_code(code):
30
for pair in OSX_SCRIPT_CODES_LIST:
31
if pair[0] == code and pair[1] is not None:
35
OSX_SCRIPT_CODES_LIST = [
44
(8, "pt"), # Portuguese
45
(9, "no"), # Norwegian
47
(11, "ja"), # Japanese
51
(15, "is"), # Icelandic
54
(18, "hr"), # Croatian
55
(19, "zh"), # TradChinese
60
(24, "lt"), # Lithuanian
62
(26, "hu"), # Hungarian
63
(27, "et"), # Estonian
70
(33, None), # SimpChinese
72
(35, "ga"), # IrishGaelic
73
(36, "sq"), # Albanian
74
(37, "ro"), # Romanian
77
(40, "sl"), # Slovenian
80
(43, "mk"), # Macedonian
81
(44, "bg"), # Bulgarian
82
(45, "uk"), # Ukrainian
83
(46, None), # Belorussian
86
(49, "az"), # Azerbaijani
87
(50, None), # AzerbaijanAr
88
(51, "hy"), # Armenian
89
(52, "ka"), # Georgian
90
(53, "mo"), # Moldavian
94
(57, "mn"), # Mongolian
95
(58, None), # MongolianCyr
98
(61, "ks"), # Kashmiri
100
(63, "bo"), # Tibetan
102
(65, "sa"), # Sanskrit
103
(66, "mr"), # Marathi
104
(67, "bn"), # Bengali
105
(68, "as"), # Assamese
106
(69, "gu"), # Gujarati
107
(70, "pa"), # Punjabi
109
(72, "ml"), # Malayalam
110
(73, "kn"), # Kannada
113
(76, "si"), # Sinhalese
114
(77, "my"), # Burmese
117
(80, "vi"), # Vietnamese
118
(81, "id"), # Indonesian
119
(82, "tl"), # Tagalog
120
(83, "ms"), # MalayRoman
121
(84, "ml"), # MalayArabic
122
(85, "am"), # Amharic
123
(86, "ti"), # Tigrinya
126
(89, "sw"), # Swahili
127
(90, "rw"), # Kinyarwanda
132
(93, "mg"), # Malagasy
133
(94, "eo"), # Esperanto
135
(129, "eu"), # Basque
136
(130, "ca"), # Catalan
138
(132, "qu"), # Quechua
139
(133, "gn"), # Guarani
140
(134, "ay"), # Aymara
142
(136, "ug"), # Uighur
143
(137, "dz"), # Dzongkha
144
(138, "jv"), # JavaneseRom
145
(139, "su"), # SundaneseRom
146
(140, "gl"), # Galician
147
(141, "af"), # Afrikaans
148
(142, "br"), # Breton
149
(143, None), # Inuktitut
150
(144, "gd"), # ScottishGaelic
151
(145, "gv"), # ManxGaelic
152
(146, "ga"), # IrishGaelicScript
153
(147, "tog"), # Tongan
154
(148, "grc"), # GreekAncient
155
(149, "kl"), # Greenlandic
156
(150, None), # AzerbaijanRoman
157
(151, "nn") # Nynorsk