• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3#
4# Copyright (c) 2015, 2017-2018, 2020 Samuel Thibault <samuel.thibault@ens-lyon.org>
5#
6# Permission is hereby granted, free of charge, to any person obtaining a copy
7# of this software and associated documentation files (the "Software"), to deal
8# in the Software without restriction, including without limitation the rights
9# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10# copies of the Software, and to permit persons to whom the Software is
11# furnished to do so, subject to the following conditions:
12#
13#
14# The above copyright notice and this permission notice shall be included in
15# all copies or substantial portions of the Software.
16#
17#
18# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
21# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24# THE SOFTWARE.
25#
26
27TABLESDIR=@TABLESDIR@
28
29echo 'Group "Braille/Braille transcription"'
30echo 'Option "LibLouis/Braille transcription" PickOne AnySetup 10'
31echo '  Choice "None/None" ""'
32echo '  *Choice "Locale/Default for language" ""'
33echo '  Choice "Locale-g0/Default for language grade 0" ""'
34echo '  Choice "Locale-g1/Default for language grade 1" ""'
35echo '  Choice "Locale-g2/Default for language grade 2" ""'
36echo '  Choice "Locale-g3/Default for language grade 3" ""'
37echo '  Choice "HyphLocale/Default hyphenation rules for language" ""'
38
39(
40  for i in $TABLESDIR/*.utb $TABLESDIR/*.ctb
41  do
42    file=${i##*/}
43    ext=${file##*.}
44    name=${file%.$ext}
45    TYPE=""
46    LANGUAGE="$name"
47    LOCATION=""
48    GRADE=""
49    DISPLAY_NAME=""
50    display_name=$(grep ^#-display-name: "$i" | cut -d ' ' -f 2-)
51    if [ -n "$display_name" ]; then
52      # Table provides a display name, neat
53      DISPLAY_NAME=$display_name
54      LANGUAGE=$DISPLAY_NAME
55    else
56      case $name in
57	"afr-za-g1")	LANGUAGE=Afrikaans TYPE="grade 1" ;;
58	"ar-ar-g1")	LANGUAGE=Arabic TYPE="grade 1" ;;
59	"ar-fa")	LANGUAGE=Persian TYPE="grade 1" ;;
60	"as-in-g1")	LANGUAGE=Assamese TYPE="grade 1" ;;
61	"aw-in-g1")	LANGUAGE=Awadhi TYPE="grade 1" ;;
62	"be-in-g1")	LANGUAGE=Bengali TYPE="grade 1" ;;
63	"bg")		LANGUAGE=Bulgarian TYPE="grade 1" ;;
64	"bh")		LANGUAGE=Bihari TYPE="grade 1" ;;
65	"bo")		LANGUAGE=Tibetan TYPE="grade 1" ;;
66	"boxes")	TYPE="Box drawing" ;;
67	"br-in-g1")	LANGUAGE=Braj TYPE="Box drawing" ;;
68	"ca-g1")	LANGUAGE=Catalan TYPE="grade 1" ;;
69	"chr-us-g1")	LANGUAGE=Cherokee TYPE="grade 1" ;;
70	"ckb-g1")	LANGUAGE="Sorani (Kurdish)" TYPE="grade 1" ;;
71	"cs-g1")	LANGUAGE=Czech TYPE="grade 1" ;;
72	"cy-cy-g1")	LANGUAGE=Welsh TYPE="grade 1" ;;
73	"cy-cy-g2")	LANGUAGE=Welsh TYPE="grade 2" ;;
74	"Cz-Cz-g1")	LANGUAGE=Czech TYPE="grade 1" ;;
75	"da-dk-g08")	LANGUAGE=Danish TYPE="grade 0" ;;
76	"da-dk-g16")	LANGUAGE=Danish TYPE="grade 1 6 dots" ;;
77	"da-dk-g18")	LANGUAGE=Danish TYPE="grade 1 8 dots" ;;
78	"da-dk-g26")	LANGUAGE=Danish TYPE="grade 2 6 dots" ;;
79	"da-dk-g26l")	LANGUAGE=Danish TYPE="grade 2 6 dots limited" ;;
80	"da-dk-g28")	LANGUAGE=Danish TYPE="grade 2 8 dots" ;;
81	"da-dk-g28l")	LANGUAGE=Danish TYPE="grade 2 8 dots limited" ;;
82	"da-lt")	LANGUAGE=Danish TYPE="LogText" ;;
83	"de-chess")	LANGUAGE=German TYPE="Chess" ;;
84	"de-ch-g0")	LANGUAGE=German LOCATION=Swiss TYPE="grade 0" ;;
85	"de-ch-g1")	LANGUAGE=German LOCATION=Swiss TYPE="grade 1" ;;
86	"de-ch-g2")	LANGUAGE=German LOCATION=Swiss TYPE="grade 2" ;;
87	"de-de-comp8")	LANGUAGE=German LOCATION=Germany TYPE="computer" ;;
88	"de-de-g0")	LANGUAGE=German LOCATION=Germany TYPE="grade 0" ;;
89	"de-de-g1")	LANGUAGE=German LOCATION=Germany TYPE="grade 1" ;;
90	"de-de-g2")	LANGUAGE=German LOCATION=Germany TYPE="grade 2" ;;
91	"dra")		LANGUAGE=Dravidian TYPE="grade 1" ;;
92	"el")		LANGUAGE=Greek TYPE="grade 1" ;;
93	"en_CA")	LANGUAGE=English LOCATION=Canada TYPE="grade 1" ;;
94	"en-chess")	LANGUAGE=English TYPE="Chess" ;;
95	"en-gb-comp8")	LANGUAGE=English LOCATION=U.K. TYPE="computer" ;;
96	"en-gb-g1")	LANGUAGE=English LOCATION=U.K. TYPE="grade 1" ;;
97	"en-GB-g2")	LANGUAGE=English LOCATION=U.K. TYPE="grade 2" ;;
98	"en-in-g1")	LANGUAGE=English LOCATION=India  TYPE="grade 1" ;;
99	"en-ueb-g1")	LANGUAGE=English TYPE="Unified grade 1" ;;
100	"en-ueb-g2")	LANGUAGE=English TYPE="Unified grade 2" ;;
101	"en-ueb-math")	LANGUAGE=English TYPE="Unified math definitions" ;;
102	"en-us-comp6")	LANGUAGE=English LOCATION=U.S. TYPE="computer 6 dots" ;;
103	"en-us-comp8")	LANGUAGE=English LOCATION=U.S. TYPE="computer 8 dots" ;;
104	"en-us-comp8-ext")	LANGUAGE=English LOCATION=U.S. TYPE="computer 8 dots extended" ;;
105	"en-us-compbrl")	LANGUAGE=English LOCATION=U.S. TYPE="computer" ;;
106	"en-us-g1")	LANGUAGE=English LOCATION=U.S. TYPE="grade 1" ;;
107	"en-us-g2")	LANGUAGE=English LOCATION=U.S. TYPE="grade 2" ;;
108	"en-us-interline")	LANGUAGE=English LOCATION=U.S. TYPE="interline" ;;
109	"en-us-mathtext")	LANGUAGE=English LOCATION=U.S. TYPE="mathtext" ;;
110	"eo-g1")	LANGUAGE=Esperanto TYPE="grade 1" ;;
111	"eo-g1-x-system")	LANGUAGE=Esperanto TYPE="grade 1 x-system" ;;
112	"Es-Es-G0")	LANGUAGE=Spanish TYPE="grade 0" ;;
113	"Es-Es-g1")	LANGUAGE=Spanish TYPE="grade 1" ;;
114	"es-g1")	LANGUAGE=Spanish TYPE="grade 1" ;;
115	"et")		LANGUAGE=Estonian TYPE="grade 1" ;;
116	"et-g0")	LANGUAGE=Estonian TYPE="grade 0" ;;
117	"ethio-g1")	LANGUAGE=Ethiopic TYPE="grade 1" ;;
118	"fi")		LANGUAGE=Finnish TYPE="6 dot" ;;
119	"fi1")		LANGUAGE=Finnish TYPE="grade 1" ;;
120	"fi2")		LANGUAGE=Finnish TYPE="grade 2" ;;
121	"fi-fi-8dot")	LANGUAGE=Finnish TYPE="8dot" ;;
122	"fi-fi")	LANGUAGE=Finnish TYPE="6dot" ;;
123	"fr-2007")	LANGUAGE=French TYPE="2007" ;;
124	"fr-bfu-comp6")	LANGUAGE=French TYPE="Braille Français Unifié computer 6 dots" ;;
125	"fr-bfu-comp8")	LANGUAGE=French TYPE="Braille Français Unifié computer 8 dots" ;;
126	"fr-bfu-g2")	LANGUAGE=French TYPE="Braille Français Unifié grade 2" ;;
127	"fr-ca-g1")	LANGUAGE=French LOCATION=Canada TYPE="grade 1" ;;
128	"Fr-Ca-g2")	LANGUAGE=French LOCATION=Canada TYPE="grade 2" ;;
129	"fr-fr-g1")	LANGUAGE=French LOCATION=France TYPE="grade 1" ;;
130	"Fr-Fr-g2")	LANGUAGE=French LOCATION=France TYPE="grade 2" ;;
131	"ga-g1")	LANGUAGE=Gaeilge TYPE="grade 1" ;;
132	"ga-g2")	LANGUAGE=Gaeilge TYPE="grade 2" ;;
133	"gd")		LANGUAGE=Gaelic TYPE="grade 1" ;;
134	"gon")		LANGUAGE=Gondi TYPE="grade 1" ;;
135	"gr-bb")	LANGUAGE=Greek TYPE="bb" ;;
136	"gr-gr-g1")	LANGUAGE=Greek TYPE="grade 1" ;;
137	"gu-in-g1")	LANGUAGE=Gujarati TYPE="grade 1" ;;
138	"haw-us-g1")	LANGUAGE=Hawaiian TYPE="grade 1" ;;
139	"he")		LANGUAGE=Hebrew TYPE="grade 1" ;;
140	"hi-in-g1")	LANGUAGE=Hindi TYPE="grade 1" ;;
141	"hr"|"hr-g1")	LANGUAGE=Croatian TYPE="grade 1" ;;
142	"hr-comp8")	LANGUAGE=Croatian TYPE="computer 8 dots" ;;
143	"hu-hu-comp8")	LANGUAGE=Hungarian TYPE="computer 8 dots" ;;
144	"hu-hu-g1")	LANGUAGE=Hungarian TYPE="grade 1" ;;
145	"hy")		LANGUAGE=Armenian TYPE="grade 1" ;;
146	"is")		LANGUAGE=Icelandic TYPE="grade 1" ;;
147	"it-it-comp6")	LANGUAGE=Italian TYPE="computer 6 dots" ;;
148	"it-it-comp8")	LANGUAGE=Italian TYPE="computer 8 dots" ;;
149	"iu-ca-g1")	LANGUAGE=Inuktitut TYPE="grade 1" ;;
150	"ka-in-g1")	LANGUAGE=Kannada TYPE="grade 1" ;;
151	"kh-in-g1")	LANGUAGE=Khasi TYPE="grade 1" ;;
152	"ko-2006-g1")	LANGUAGE=Korean TYPE="grade 1 2006" ;;
153	"ko-2006-g2")	LANGUAGE=Korean TYPE="grade 2 2006" ;;
154	"ko-g1")	LANGUAGE=Korean TYPE="grade 1" ;;
155	"ko-g2")	LANGUAGE=Korean TYPE="grade 2" ;;
156	"kok")		LANGUAGE=Konkani TYPE="grade 1" ;;
157	"kru")		LANGUAGE=Kurukh TYPE="grade 1" ;;
158	"ks-in-g1")	LANGUAGE=Kashmiri TYPE="grade 1" ;;
159	"lt")		LANGUAGE=Lithuanian TYPE="grade 1" ;;
160	"lt-6dot")	LANGUAGE=Lithuanian TYPE="6 dots" ;;
161	"Lv-Lv-g1")	LANGUAGE=Latvian TYPE="grade 1" ;;
162	"mao-nz-g1")	LANGUAGE=Maori TYPE="grade 1" ;;
163	"marburg")	TYPE="Marburg maths" ;;
164	"marburg_edit")	TYPE="Marburg maths post-translation editing" ;;
165	"ml-in-g1")	LANGUAGE=Malayalam TYPE="grade 1" ;;
166	"mn-in-g1")	LANGUAGE=Manipuri TYPE="grade 1" ;;
167	"mn-MN"|"mn-MN-g1")	LANGUAGE=Mongolian TYPE="grade 1" ;;
168	"mn-MN-g2")	LANGUAGE=Mongolian TYPE="grade 2" ;;
169	"mr-in-g1")	LANGUAGE=Marathi TYPE="grade 1" ;;
170	"mt")		LANGUAGE=Maltese TYPE="grade 1" ;;
171	"mun")		LANGUAGE=Munda TYPE="grade 1" ;;
172	"mwr")		LANGUAGE=Marwari TYPE="grade 1" ;;
173	"ne")		LANGUAGE=Nepali TYPE="grade 1" ;;
174	"nemeth")	TYPE="Nemeth Maths" ;;
175	"nemeth_edit")	TYPE="Nemeth Maths post-translation editing" ;;
176	"nl-BE-g0")	LANGUAGE=Dutch LOCATION=Belgium TYPE="grade 0" ;;
177	"nl-g0")	LANGUAGE=Dutch TYPE="grade 0" ;;
178	"nl-NL-g0")	LANGUAGE=Dutch LOCATION="Netherlands" TYPE="grade 0" ;;
179	"Nl-Nl-g1")	LANGUAGE=Dutch LOCATION=Netherlands TYPE="grade 1" ;;
180	"no-no-8dot-fallback-6dot-g0")	LANGUAGE=Norwegian TYPE="grade 0 8 dots fallback 6 dots" ;;
181	"no-no-8dot")	LANGUAGE=Norwegian TYPE="grade 0 8 dots" ;;
182	"no-no-comp8")	LANGUAGE=Norwegian TYPE="grade 0 computer" ;;
183	"no-no-g0")	LANGUAGE=Norwegian TYPE="grade 0" ;;
184	"no-no-g1")	LANGUAGE=Norwegian TYPE="grade 1" ;;
185	"no-no-g2")	LANGUAGE=Norwegian TYPE="grade 2" ;;
186	"no-no-g3")	LANGUAGE=Norwegian TYPE="grade 3" ;;
187	"no-no-generic")	LANGUAGE=Norwegian TYPE="generic" ;;
188	"np-in-g1")	LANGUAGE=Nepali TYPE="grade 1" ;;
189	"or-in-g1")	LANGUAGE=Oriya TYPE="grade 1" ;;
190	"pi")		LANGUAGE=Pali TYPE="grade 1" ;;
191	"pl-pl-comp8")	LANGUAGE=Polish TYPE="computer" ;;
192	"Pl-Pl-g1")	LANGUAGE=Polish TYPE="grade 1" ;;
193	"pt-pt-comp8")	LANGUAGE=Portuguese TYPE="computer" ;;
194	"pt-pt-g1")	LANGUAGE=Portuguese TYPE="grade 1" ;;
195	"pt-pt-g2")	LANGUAGE=Portuguese TYPE="grade 2" ;;
196	"pu-in-g1")	LANGUAGE=Punjabi TYPE="grade 1" ;;
197	"ro")		LANGUAGE=Romanian TYPE="grade 1" ;;
198	"ru-compbrl")	LANGUAGE=Russian TYPE="computer" ;;
199	"ru")		LANGUAGE=Russian TYPE="grade 1" ;;
200	"ru-litbrl")	LANGUAGE=Russian TYPE="literary" ;;
201	"ru-ru-g1")	LANGUAGE=Russian TYPE="grade 1" ;;
202	"sa-in-g1")	LANGUAGE=Sasnskrit TYPE="grade 1" ;;
203	"se-se")	LANGUAGE=Swedish TYPE="grade 1" ;;
204	"Se-Se-g1")	LANGUAGE=Swedish TYPE="grade 1" ;;
205	"si-in-g1")	LANGUAGE=Sindhi TYPE="grade 1" ;;
206	"sin")		LANGUAGE=Sinhala TYPE="grade 1" ;;
207	"sk-g1")	LANGUAGE=Slovak TYPE="grade 1" ;;
208	"sk-sk-g1")	LANGUAGE=Slovak TYPE="grade 1" ;;
209	"sk-sk")	LANGUAGE=Slovak TYPE="grade 1" ;;
210	"sl-si-comp8")	LANGUAGE=Slovenian TYPE="computer" ;;
211	"sl-si-g1")	LANGUAGE=Slovenian TYPE="grade 1" ;;
212	"sot-za-g1")	LANGUAGE=Sotho TYPE="grade 1" ;;
213	"spaces")	TYPE="Spaces" ;;
214	"sr-g1")	LANGUAGE=Serbian TYPE="grade 1" ;;
215	"sv-1989")	LANGUAGE=Swedish TYPE="1989" ;;
216	"sv-1996")	LANGUAGE=Swedish TYPE="1996" ;;
217	"ta")		LANGUAGE=Tamil TYPE="grade 1" ;;
218	"ta-ta-g1")	LANGUAGE=Tamil TYPE="grade 1" ;;
219	"te-in-g1")	LANGUAGE=Telugu TYPE="grade 1" ;;
220	"tr"|"tr-g1")	LANGUAGE=Turkish TYPE="grade 1" ;;
221	"tr-g2")	LANGUAGE=Turkish TYPE="grade 2" ;;
222	"tsn-za-g1")	LANGUAGE=Tswana TYPE="grade 1" ;;
223	"UEBC-g1")	LANGUAGE=English TYPE="Unified grade 1" ;;
224	"UEBC-g2")	LANGUAGE=English TYPE="Unified grade 2" ;;
225	"ukmaths")	TYPE="U.K maths" ;;
226	"ukmaths_edit")	TYPE="U.K maths post-translation editing" ;;
227	"ur-pk-g1")	LANGUAGE=Urdu TYPE="grade 1" ;;
228	"ur-pk-g2")	LANGUAGE=Urdu TYPE="grade 2" ;;
229	"vi")		LANGUAGE=Vietnamese TYPE="grade 1" ;;
230	"vi-g1")	LANGUAGE=Vietnamese TYPE="grade 1" ;;
231	"wiskunde")	LANGUAGE=Flemish TYPE="grade 1" ;;
232	"zh-hk")	LANGUAGE=Chinese LOCATION="Hong Kong" TYPE="grade 1" ;;
233	"zh-tw")	LANGUAGE=Chinese LOCATION="Taiwan" TYPE="grade 1" ;;
234	"zh-chn")	LANGUAGE=Chinese LOCATION="China" TYPE="grade 1" ;;
235	*)		locale=$(grep ^#+locale: "$i" | cut -d ':' -f 2-)
236			if [ -n "$locale" ]; then
237			  LANGUAGE="$locale"
238			fi
239			if [ $ext = ctb ]; then
240			  TYPE="contracted"
241			else
242			  TYPE="computer"
243			fi
244			;;
245      esac
246    fi
247    echo "$file:$LANGUAGE:$LOCATION:$TYPE:$DISPLAY_NAME"
248  done
249
250  for i in $TABLESDIR/hyph_*.dic
251  do
252    file=${i##*/}
253    name=${file%.dic}
254    name=${name#hyph_}
255    DESC=$name
256    LANGUAGE=""
257    LOCATION=""
258    GRADE=""
259    case $name in
260	brl_da_dk)	LANGUAGE=Danish ;;
261	cs_CZ)	LANGUAGE=Czech ;;
262	da_DK)	LANGUAGE=Danish ;;
263	de_DE)	LANGUAGE=German ;;
264	en_US)	LANGUAGE=English ;;
265	eo)	LANGUAGE=Esperanto ;;
266	es_ES)	LANGUAGE=Spanish ;;
267	fr_FR)	LANGUAGE=French ;;
268	hu_HU)	LANGUAGE=Hungarian ;;
269	it_IT)	LANGUAGE=Italian ;;
270	nb_NO)	LANGUAGE="Norwegian Bokmål" ;;
271	nl_NL)	LANGUAGE=Dutch ;;
272	nn_NO)	LANGUAGE="Norwegian Nynorsk" ;;
273	pl_PL)	LANGUAGE=Polish ;;
274	pt_PT)	LANGUAGE=Portuguese ;;
275	ru)	LANGUAGE=Russian ;;
276	sv_SE)	LANGUAGE=Swedish ;;
277	*)      LANGUAGE=$name ;;
278    esac
279    echo "$file:$LANGUAGE:$LOCATION:hyphenation rules:"
280  done
281
282) | LC_ALL=C sort -f -t : -k 2,3 | (
283
284IFS=:
285while read file LANGUAGE LOCATION TYPE DISPLAY_NAME
286do
287	DESC="$TYPE ($file)"
288	[ -n "$LOCATION" ] && DESC="$LOCATION $DESC"
289	[ -n "$LANGUAGE" ] && DESC="$LANGUAGE $DESC"
290	[ -n "$DISPLAY_NAME" ] && DESC="$DISPLAY_NAME ($file)"
291	echo "  Choice \"$file/$DESC\" \"\""
292done
293)
294
295