File: support.ca.pl

package info (click to toggle)
language-env 0.64
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,588 kB
  • ctags: 125
  • sloc: perl: 6,243; makefile: 83; tcl: 64; sh: 18
file content (339 lines) | stat: -rw-r--r-- 11,318 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# !Catala,Catalan! -*-coding: iso-8859-1;-*-
#
#
#
# ---------------------------------------------------
# isNC()
# ---------------------------------------------------
sub isNC($$$)
{
	return 0;
}

# ---------------------------------------------------
# initialize()
# ---------------------------------------------------
sub initialize()
{
	&Sub::addlist("locales");
#	&Sub::addlist("manpages-es");
#	&Sub::addlist("manpages-es-extra");
#	&Sub::addlist("doc-linux-es");
#	&Sub::addlist("doc-debian-es");
	if (&Sub::isinstalled("ispell"))
	{
		&Sub::addlist("icatalan");
		&Sub::addlist("wcatalan");
	}
	if (&Sub::isinstalled("libaspell.*"))
		{&Sub::addlist("aspell-ca");}
	if (&Sub::isinstalled("kde-core"))
		{&Sub::addlist("kde-i18n-ca");}

	@locales = glob("/usr/lib/locale/ca*");
	@countries = (
		'ES!Spain',
		'FR!France',
		'AD!Andorra');
	$num = 0; $default = 0;
	foreach $country (@countries) {
		@c = split(/!/, $country);
		$pattern = "ca_" . $c[0];
		if (grep($_ =~ /$pattern/, @locales) && $default == 0) {
			$default = $num;
		}
		print $num+1,". ",$c[1],"\n";
		$num ++;
	}
	print $num+1,". altres\n";

	$territory = &Sub::select(
		"En quin pais viviu?\n" . $choices,
		"En quin pas viviu?\n" . $choices,
		$num+1, $default+1);

	if ($territory == $num+1) {
		$Sub::COUNTRY = &Sub::ask(
			"Introduiu el codi de pais de dues lletres ISO3166 ",
			"Introduu el codi de pas de dues lletres ISO3166 ");
	} else {
		@c = split(/!/,$countries[$territory - 1]);
		$Sub::COUNTRY = $c[0];
	}

	if ($Sub::COUNTRY eq 'ES') {
		$Sub::ISO885915 = &Sub::yesno(
			"Voleu emprar ISO-8859-15 (simbol de l'euro)?",
			"Voleu emprar ISO-8859-15 (smbol de l'euro)?");
	} else {
		$Sub::ISO885915 = &Sub::noyes(
			"Voleu emprar ISO-8859-15 (simbol de l'euro)?",
			"Voleu emprar ISO-8859-15 (smbol de l'euro)?");
	}

	if ($Sub::ISO885915) {
		$Sub::LOCALE = "ca_" . $Sub::COUNTRY . "\@euro";
		$Sub::ENCODING = "ISO-8859-15";
		$Lang::need_locale = "$Sub::LOCALE($Sub::LOCALE!ISO-8859-15)";
		foreach $i ("xfonts-base", "xfonts-100dpi", "xfonts-75dpi") {
			if (&Sub::isinstalled($i)) {
				&Sub::addlist($i . "-transcoded");
			}
		}
	} else {
		$Sub::LOCALE = "ca_" . $Sub::COUNTRY;
		$Sub::ENCODING = "ISO-8859-1";
		$Lang::need_locale = "$Sub::LOCALE($Sub::LOCALE!ISO-8859-1)";
	}
	return 0;
}

# ---------------------------------------------------
# sourceset2displayset()
# ---------------------------------------------------
sub sourceset2displayset ($)
{
	return $_[0];
}

# ---------------------------------------------------
# analcode() is a subroutine to guess the codeset of
# string given by a parameter.  The meaning of the
# result value is same to convcode().
#
# This subroutine is used to detect the codeset of
# existing dotfiles because the additional contents
# have to be written in the same codeset to the
# existing contents.  Of course this subroutine
# is needed only for languages for which multiple
# codesets are used.
#
# The programmer for each language can determine
# the meaning of the return value of this subroutine.
# For example, Japanese version of analcode returns
# 'JIS' for ISO-2022-JP codeset, 'SJIS' for Shift-JIS
# codeset, and 'EUC' for EUC-JP codeset.
# ---------------------------------------------------
sub analcode($)
{
	return 0;
}

# ---------------------------------------------------
# Convert the given string from its codeset into the
# given codeset.  The string is given by the 1st 
# parameter and the codeset is given by the 2nd 
# parameter.  The actual value of the 2nd parameter
# has to be the same as the return value of analcode
# subroutine.
#
# This subroutine is used to write additional contents
# to dotfiles in proper codeset.  Of course this 
# subroutine is needed only for languages for which
# multiple codesets are used.
# ---------------------------------------------------
sub convcode($$)
{
	return $_[0];
}


# ---------------------------------------------------
# This hash variable contains translated messages in your language.
# This is similar to catalog file for gettext.
#
# The KEYs of the hash are original strings in the source code
# (/usr/bin/set-language-env).  The VALUEs of the hash are translated
# messages.  One VALUE can contain two messages whose meanings are
# same.  These two messages are separated by "\000".  The first
# message has to be expressed by ASCII characters (NOT ISO-8859-1!!!)
# and the second one can contain native characters such as Kanji,
# characters with umlaut and Cyrillic characters. The second messages
# has to written in the Source Character Codeset (see the comment
# for sourceset2displayset() subroutine).  The second messages can
# be omitted if it is same as the first one.
# ---------------------------------------------------

%messages = (

# msgid
  "\nPush [Enter] key to End.\n" =>
# msgstr1 (in native language but in ASCII)
  "\nPremeu la tecla [Intro] per a finalitzar.\n\000".
# msgstr2 (in native language and in native character set: for
# example ISO-8859-1)
  "\nPremeu la tecla [Intro] per a finalitzar.\n" ,

# msgid
  "Now obtaining package list...\n" =>
  "S'esta obtenint la llista de paquets...\n\000".
  "S'est obtenint la llista de paquets...\n" ,

# msgid
  "Do setting? " =>
  "Voleu fer els canvis? \000".
  "Voleu fer els canvis? " ,

# msgid
  "Setting is not done.\n" =>
  "No facis els canvis.\n\000".
  "No facis els canvis.\n" ,

# msgid
  "Do setting...\n" =>
  "Fes els canvis...\n\000".
  "Fes els canvis...\n" ,

# msgid
  "Cannot read \"%s\".\n" =>
  "No es pot llegir \"%s\".\n\000".
  "No es pot llegir \"%s\".\n" ,

# msgid
  "Making a new file \"%s\"...\n" =>
  "S'esta creant el nou fitxer \"%s\"...\n\000".
  "S'est creant el nou fitxer \"%s\"...\n" ,

# msgid
  "Cannot open \"%s\".\n" =>
  "No es pot obrir \"%s\".\n\000".
  "No es pot obrir \"%s\".\n" ,

# msgid
  "Cannot write to \"%s\".\n" =>
  "No es pot escriure a \"%s\".\n\000".
# msgstr2 (in Native Character Set)
  "No es pot escriure a \"%s\".\n" ,

# msgid
  "Cannot lock \"%s\".\n" =>
# msgstr1 (ASCII)
  "No es pot blocar \"%s\".\n\000".
# msgstr2 (in Native Character Set)
  "No es pot blocar \"%s\".\n" ,

# msgid
  "Cannot close \"%s\".\n" =>
# msgstr1 (ASCII)
  "No es pot tancar \"%s\".\n\000".
# msgstr2 (in Native Character Set)
  "No es pot tancar \"%s\".\n" ,

# msgid
  "Install the following packages.\n" =>
# msgstr1 (ASCII)
  "Instal.leu els seguents paquets.\n\000".
# msgstr2 (in Native Character Set)
  "Installeu els segents paquets.\n" ,

# msgid
  "   Setting is now done.  To activate these settings,\n".
  "logout and login.\n".
  "   Read each dotfile and confirm the modification.\n".
  "If you don't like the setting, modify directly or\n".
  "add overriding setting after 'language-env end' line.\n".
  "   Read /usr/share/doc/language-env/README.* for detail.\n" =>
# msgstr1 (ASCII)
  "   Ja s'han fet els canvis. Per a activar la nova configuracio,\n".
  "sortiu del compte i torneu a entrar.\n".
  "   Llegiu cada fitxer de configuracio i confirmeu les modificacions.\n".
  "Si no us agrada la configuracio, modifiqueu-la directament o afegiu\n".
  "configuracions que la reemplacen despres de la linia\n".
  "\"language-env end\".\n".
  "   Llegiu /usr/share/doc/language-env/README.* per a mes detalls.\n\000".
# msgstr2 (in Native Character Set)
  "   Ja s'han fet els canvis. Per a activar la nova configuraci,\n".
  "sortiu del compte i torneu a entrar.\n".
  "   Llegiu cada fitxer de configuraci i confirmeu les modificacions.\n".
  "Si no us agrada la configuraci, modifiqueu-la directament o afegiu\n".
  "configuracions que la reemplacen desprs de la lnia\n".
  "\"language-env end\".\n".
  "   Llegiu /usr/share/doc/language-env/README.* per a ms detalls.\n",

# msgid
  "Usage: set-language-env [options]\n".
  "  -l language : Specify language (otherwise choose from menu)\n".
  "  -h          : This help message\n".
  "  -v          : 'verbose mode'\n".
  "  -s          : Display list of supported languages and exit\n".
  "  -r          : Remove all settings\n".
  "  -N          : Never fork another set-language-env (for internal use)\n".
  "  -c          : Don't use native character set (for internal use)\n".
  "  -C          : Use native character set (for internal use)\n".
  "  -E          : Setting for /etc/skel directory (root user only)\n" =>
# msgstr1 (ASCII)
  "Forma d'us: set-language-env [opcions]\n".
  "  -l llengua : Especifica la llengua (o si no, selecciona del menu)\n".
  "  -h         : Aquest missatge d'ajuda\n".
  "  -v         : \"mode detallat\"\n".
  "  -s         : Mostra la llista de llengues suportades i ix\n".
  "  -r         : Suprimeix totes les configuracions\n".
  "  -N         : Mai bifurca altres set-language-env (per a us intern)\n".
  "  -c         : No utilitza el joc de caracters natiu (per a us intern)\n".
  "  -C         : Utilitza el joc de caracters natiu (per a us intern)\n".
  "  -E         : Configuracio per al directori /etc/skel (nomes root)\n\000".
# msgstr2 (in Native Character Set)
  "Forma d's: set-language-env [opcions]\n".
  "  -l llengua : Especifica la llengua (o si no, selecciona del men)\n".
  "  -h         : Aquest missatge d'ajuda\n".
  "  -v         : mode detallat\n".
  "  -s         : Mostra la llista de llenges suportades i ix\n".
  "  -r         : Suprimeix totes les configuracions\n".
  "  -N         : Mai bifurca altres set-language-env (per a s intern)\n".
  "  -c         : No utilitza el joc de carcters natiu (per a s intern)\n".
  "  -C         : Utilitza el joc de carcters natiu (per a s intern)\n".
  "  -E         : Configuraci per al directori /etc/skel (noms root)\n",

# msgid
  "Install the following locales.\n" =>
# msgstr1 (ASCII)
  "Instal.leu els seguents locales.\n\000".
# msgstr2 (in Native Character Set)
  "Installeu els segents locales.\n" ,

# msgid
  "(Edit /etc/locale.gen and invoke locale-gen)\n" =>
# msgstr1 (ASCII)
  "(Editeu /etc/locale.gen i executeu locale-gen)\n\000".
# msgstr2 (in Native Character Set)
  "(Editeu /etc/locale.gen i executeu locale-gen)\n" ,

# msgid
  "" =>
# msgstr1 (ASCII)
  "\000".
# msgstr2 (in Native Character Set)
  ""

);

# ---------------------------------------------------
# These variables describe which characters to be used
# for user input to express 'yes' and 'no' in native 
# language.  '*_upper' and '*_lower' have to be 
# different because upper one is used to express
# default reply (when only Enter is pressed).  ASCII
# codeset has to be used.  (NOT ISO-8859-1!!!!)
# ---------------------------------------------------
$yes_upper = "S";
$yes_lower = "s";
$no_upper = "N";
$no_lower = "n";

# ---------------------------------------------------
# This variable shows the needed locale.  This is
# introduced since language-env 0.12 because locales
# package stopped to supply precompiled locale data
# since locales 2.2-1.
#
# The check is done by whether the directory of
# /usr/lib/locales/$needlocale exists or not.
#
# Multiple locales can be specified with delimiter
# of space code.
#
# You may specify how to write /etc/locale.gen line
# for the locale like the following.  In the string,
# whitespace must be replaced by "!".
# ---------------------------------------------------
# $need_locale = 'ca_ES ca_ES@euro';