source: josm/trunk/src/org/openstreetmap/josm/tools/I18n.java@ 13507

Last change on this file since 13507 was 13507, checked in by stoecker, 6 years ago

see #11392 - take new shorter I18n implementation also for plugins

  • Property svn:eol-style set to native
File size: 25.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4import java.io.BufferedInputStream;
5import java.io.File;
6import java.io.IOException;
7import java.io.InputStream;
8import java.lang.annotation.Retention;
9import java.lang.annotation.RetentionPolicy;
10import java.net.URL;
11import java.nio.charset.StandardCharsets;
12import java.nio.file.Files;
13import java.nio.file.InvalidPathException;
14import java.text.MessageFormat;
15import java.util.ArrayList;
16import java.util.Arrays;
17import java.util.Collection;
18import java.util.Comparator;
19import java.util.HashMap;
20import java.util.Locale;
21import java.util.Map;
22import java.util.zip.ZipEntry;
23import java.util.zip.ZipFile;
24
25/**
26 * Internationalisation support.
27 *
28 * @author Immanuel.Scholz
29 */
30public final class I18n {
31
32 /**
33 * This annotates strings which do not permit a clean i18n. This is mostly due to strings
34 * containing two nouns which can occur in singular or plural form.
35 * <br>
36 * No behaviour is associated with this annotation.
37 */
38 @Retention(RetentionPolicy.SOURCE)
39 public @interface QuirkyPluralString {
40 }
41
42 private I18n() {
43 // Hide default constructor for utils classes
44 }
45
46 /**
47 * Enumeration of possible plural modes. It allows us to identify and implement logical conditions of
48 * plural forms defined on <a href="https://help.launchpad.net/Translations/PluralForms">Launchpad</a>.
49 * See <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html">CLDR</a>
50 * for another complete list.
51 * @see #pluralEval
52 */
53 private enum PluralMode {
54 /** Plural = Not 1. This is the default for many languages, including English: 1 day, but 0 days or 2 days. */
55 MODE_NOTONE,
56 /** No plural. Mainly for Asian languages (Indonesian, Chinese, Japanese, ...) */
57 MODE_NONE,
58 /** Plural = Greater than 1. For some latin languages (French, Brazilian Portuguese) */
59 MODE_GREATERONE,
60 /* Special mode for
61 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ar">Arabic</a>.*
62 MODE_AR,*/
63 /** Special mode for
64 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#cs">Czech</a>. */
65 MODE_CS,
66 /** Special mode for
67 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#pl">Polish</a>. */
68 MODE_PL,
69 /* Special mode for
70 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ro">Romanian</a>.*
71 MODE_RO,*/
72 /** Special mode for
73 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#lt">Lithuanian</a>. */
74 MODE_LT,
75 /** Special mode for
76 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ru">Russian</a>. */
77 MODE_RU,
78 /** Special mode for
79 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#sk">Slovak</a>. */
80 MODE_SK,
81 /* Special mode for
82 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#sl">Slovenian</a>.*
83 MODE_SL,*/
84 }
85
86 private static volatile PluralMode pluralMode = PluralMode.MODE_NOTONE; /* english default */
87 private static volatile String loadedCode = "en";
88
89
90 private static volatile Map<String, String> strings;
91 private static volatile Map<String, String[]> pstrings;
92 private static Map<String, PluralMode> languages = new HashMap<>();
93 static {
94 //languages.put("ar", PluralMode.MODE_AR);
95 languages.put("ast", PluralMode.MODE_NOTONE);
96 languages.put("bg", PluralMode.MODE_NOTONE);
97 languages.put("be", PluralMode.MODE_RU);
98 languages.put("ca", PluralMode.MODE_NOTONE);
99 languages.put("ca@valencia", PluralMode.MODE_NOTONE);
100 languages.put("cs", PluralMode.MODE_CS);
101 languages.put("da", PluralMode.MODE_NOTONE);
102 languages.put("de", PluralMode.MODE_NOTONE);
103 languages.put("el", PluralMode.MODE_NOTONE);
104 languages.put("en_AU", PluralMode.MODE_NOTONE);
105 languages.put("en_GB", PluralMode.MODE_NOTONE);
106 languages.put("es", PluralMode.MODE_NOTONE);
107 languages.put("et", PluralMode.MODE_NOTONE);
108 //languages.put("eu", PluralMode.MODE_NOTONE);
109 languages.put("fi", PluralMode.MODE_NOTONE);
110 languages.put("fr", PluralMode.MODE_GREATERONE);
111 languages.put("gl", PluralMode.MODE_NOTONE);
112 //languages.put("he", PluralMode.MODE_NOTONE);
113 languages.put("hu", PluralMode.MODE_NOTONE);
114 languages.put("id", PluralMode.MODE_NONE);
115 //languages.put("is", PluralMode.MODE_NOTONE);
116 languages.put("it", PluralMode.MODE_NOTONE);
117 languages.put("ja", PluralMode.MODE_NONE);
118 // fully supported only with Java 8 and later (needs CLDR)
119 languages.put("km", PluralMode.MODE_NONE);
120 languages.put("lt", PluralMode.MODE_LT);
121 languages.put("nb", PluralMode.MODE_NOTONE);
122 languages.put("nl", PluralMode.MODE_NOTONE);
123 languages.put("pl", PluralMode.MODE_PL);
124 languages.put("pt", PluralMode.MODE_NOTONE);
125 languages.put("pt_BR", PluralMode.MODE_GREATERONE);
126 //languages.put("ro", PluralMode.MODE_RO);
127 languages.put("ru", PluralMode.MODE_RU);
128 languages.put("sk", PluralMode.MODE_SK);
129 //languages.put("sl", PluralMode.MODE_SL);
130 languages.put("sv", PluralMode.MODE_NOTONE);
131 //languages.put("tr", PluralMode.MODE_NONE);
132 languages.put("uk", PluralMode.MODE_RU);
133 languages.put("vi", PluralMode.MODE_NONE);
134 languages.put("zh_CN", PluralMode.MODE_NONE);
135 languages.put("zh_TW", PluralMode.MODE_NONE);
136 }
137
138 /**
139 * Translates some text for the current locale.
140 * These strings are collected by a script that runs on the source code files.
141 * After translation, the localizations are distributed with the main program.
142 * <br>
143 * For example, <code>tr("JOSM''s default value is ''{0}''.", val)</code>.
144 * <br>
145 * Use {@link #trn} for distinguishing singular from plural text, i.e.,
146 * do not use {@code tr(size == 1 ? "singular" : "plural")} nor
147 * {@code size == 1 ? tr("singular") : tr("plural")}
148 *
149 * @param text the text to translate.
150 * Must be a string literal. (No constants or local vars.)
151 * Can be broken over multiple lines.
152 * An apostrophe ' must be quoted by another apostrophe.
153 * @param objects the parameters for the string.
154 * Mark occurrences in {@code text} with <code>{0}</code>, <code>{1}</code>, ...
155 * @return the translated string.
156 * @see #trn
157 * @see #trc
158 * @see #trnc
159 */
160 public static String tr(String text, Object... objects) {
161 if (text == null) return null;
162 return MessageFormat.format(gettext(text, null), objects);
163 }
164
165 /**
166 * Translates some text in a context for the current locale.
167 * There can be different translations for the same text within different contexts.
168 *
169 * @param context string that helps translators to find an appropriate
170 * translation for {@code text}.
171 * @param text the text to translate.
172 * @return the translated string.
173 * @see #tr
174 * @see #trn
175 * @see #trnc
176 */
177 public static String trc(String context, String text) {
178 if (context == null)
179 return tr(text);
180 if (text == null)
181 return null;
182 return MessageFormat.format(gettext(text, context), (Object) null);
183 }
184
185 public static String trcLazy(String context, String text) {
186 if (context == null)
187 return tr(text);
188 if (text == null)
189 return null;
190 return MessageFormat.format(gettextLazy(text, context), (Object) null);
191 }
192
193 /**
194 * Marks a string for translation (such that a script can harvest
195 * the translatable strings from the source files).
196 *
197 * For example, <code>
198 * String[] options = new String[] {marktr("up"), marktr("down")};
199 * lbl.setText(tr(options[0]));</code>
200 * @param text the string to be marked for translation.
201 * @return {@code text} unmodified.
202 */
203 public static String marktr(String text) {
204 return text;
205 }
206
207 public static String marktrc(String context, String text) {
208 return text;
209 }
210
211 /**
212 * Translates some text for the current locale and distinguishes between
213 * {@code singularText} and {@code pluralText} depending on {@code n}.
214 * <br>
215 * For instance, {@code trn("There was an error!", "There were errors!", i)} or
216 * <code>trn("Found {0} error in {1}!", "Found {0} errors in {1}!", i, Integer.toString(i), url)</code>.
217 *
218 * @param singularText the singular text to translate.
219 * Must be a string literal. (No constants or local vars.)
220 * Can be broken over multiple lines.
221 * An apostrophe ' must be quoted by another apostrophe.
222 * @param pluralText the plural text to translate.
223 * Must be a string literal. (No constants or local vars.)
224 * Can be broken over multiple lines.
225 * An apostrophe ' must be quoted by another apostrophe.
226 * @param n a number to determine whether {@code singularText} or {@code pluralText} is used.
227 * @param objects the parameters for the string.
228 * Mark occurrences in {@code singularText} and {@code pluralText} with <code>{0}</code>, <code>{1}</code>, ...
229 * @return the translated string.
230 * @see #tr
231 * @see #trc
232 * @see #trnc
233 */
234 public static String trn(String singularText, String pluralText, long n, Object... objects) {
235 return MessageFormat.format(gettextn(singularText, pluralText, null, n), objects);
236 }
237
238 /**
239 * Translates some text in a context for the current locale and distinguishes between
240 * {@code singularText} and {@code pluralText} depending on {@code n}.
241 * There can be different translations for the same text within different contexts.
242 *
243 * @param context string that helps translators to find an appropriate
244 * translation for {@code text}.
245 * @param singularText the singular text to translate.
246 * Must be a string literal. (No constants or local vars.)
247 * Can be broken over multiple lines.
248 * An apostrophe ' must be quoted by another apostrophe.
249 * @param pluralText the plural text to translate.
250 * Must be a string literal. (No constants or local vars.)
251 * Can be broken over multiple lines.
252 * An apostrophe ' must be quoted by another apostrophe.
253 * @param n a number to determine whether {@code singularText} or {@code pluralText} is used.
254 * @param objects the parameters for the string.
255 * Mark occurrences in {@code singularText} and {@code pluralText} with <code>{0}</code>, <code>{1}</code>, ...
256 * @return the translated string.
257 * @see #tr
258 * @see #trc
259 * @see #trn
260 */
261 public static String trnc(String context, String singularText, String pluralText, long n, Object... objects) {
262 return MessageFormat.format(gettextn(singularText, pluralText, context, n), objects);
263 }
264
265 private static String gettext(String text, String ctx, boolean lazy) {
266 int i;
267 if (ctx == null && text.startsWith("_:") && (i = text.indexOf('\n')) >= 0) {
268 ctx = text.substring(2, i-1);
269 text = text.substring(i+1);
270 }
271 if (strings != null) {
272 String trans = strings.get(ctx == null ? text : "_:"+ctx+'\n'+text);
273 if (trans != null)
274 return trans;
275 }
276 if (pstrings != null) {
277 i = pluralEval(1);
278 String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+'\n'+text);
279 if (trans != null && trans.length > i)
280 return trans[i];
281 }
282 return lazy ? gettext(text, null) : text;
283 }
284
285 private static String gettext(String text, String ctx) {
286 return gettext(text, ctx, false);
287 }
288
289 /* try without context, when context try fails */
290 private static String gettextLazy(String text, String ctx) {
291 return gettext(text, ctx, true);
292 }
293
294 private static String gettextn(String text, String plural, String ctx, long num) {
295 int i;
296 if (ctx == null && text.startsWith("_:") && (i = text.indexOf('\n')) >= 0) {
297 ctx = text.substring(2, i-1);
298 text = text.substring(i+1);
299 }
300 if (pstrings != null) {
301 i = pluralEval(num);
302 String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+'\n'+text);
303 if (trans != null && trans.length > i)
304 return trans[i];
305 }
306
307 return num == 1 ? text : plural;
308 }
309
310 public static String escape(String msg) {
311 if (msg == null) return null;
312 return msg.replace("\'", "\'\'").replace("{", "\'{\'").replace("}", "\'}\'");
313 }
314
315 private static URL getTranslationFile(String lang) {
316 return I18n.class.getResource("/data/"+lang.replace('@', '-')+".lang");
317 }
318
319 /**
320 * Get a list of all available JOSM Translations.
321 * @return an array of locale objects.
322 */
323 public static Locale[] getAvailableTranslations() {
324 Collection<Locale> v = new ArrayList<>(languages.size());
325 if (getTranslationFile("en") != null) {
326 for (String loc : languages.keySet()) {
327 if (getTranslationFile(loc) != null) {
328 v.add(LanguageInfo.getLocale(loc));
329 }
330 }
331 }
332 v.add(Locale.ENGLISH);
333 Locale[] l = new Locale[v.size()];
334 l = v.toArray(l);
335 Arrays.sort(l, Comparator.comparing(Locale::toString));
336 return l;
337 }
338
339 /**
340 * Determines if a language exists for the given code.
341 * @param code The language code
342 * @return {@code true} if a language exists, {@code false} otherwise
343 */
344 public static boolean hasCode(String code) {
345 return languages.containsKey(code);
346 }
347
348 static void setupJavaLocaleProviders() {
349 // Look up SPI providers first (for JosmDecimalFormatSymbolsProvider).
350 // Enable CLDR locale provider on Java 8 to get additional languages, such as Khmer.
351 // http://docs.oracle.com/javase/8/docs/technotes/guides/intl/enhancements.8.html#cldr
352 // FIXME: This must be updated after we switch to Java 9.
353 // See https://docs.oracle.com/javase/9/docs/api/java/util/spi/LocaleServiceProvider.html
354 System.setProperty("java.locale.providers", "SPI,JRE,CLDR"); // Don't call Utils.updateSystemProperty to avoid spurious log at startup
355 }
356
357 /**
358 * I18n initialization.
359 */
360 public static void init() {
361 setupJavaLocaleProviders();
362
363 /* try initial language settings, may be changed later again */
364 if (!load(LanguageInfo.getJOSMLocaleCode())) {
365 Locale.setDefault(Locale.ENGLISH);
366 }
367 }
368
369 /**
370 * I18n initialization for plugins.
371 * @param source file path/name of the JAR or Zip file containing translation strings
372 * @since 4159
373 */
374 public static void addTexts(File source) {
375 if ("en".equals(loadedCode))
376 return;
377 final ZipEntry enfile = new ZipEntry("data/en.lang");
378 final ZipEntry langfile = new ZipEntry("data/"+loadedCode+".lang");
379 try (
380 ZipFile zipFile = new ZipFile(source, StandardCharsets.UTF_8);
381 InputStream orig = zipFile.getInputStream(enfile);
382 InputStream trans = zipFile.getInputStream(langfile);
383 ) {
384 if (orig != null && trans != null)
385 load(orig, trans, true);
386 } catch (IOException | InvalidPathException e) {
387 Logging.trace(e);
388 }
389 }
390
391 private static boolean load(String l) {
392 if ("en".equals(l) || "en_US".equals(l)) {
393 strings = null;
394 pstrings = null;
395 loadedCode = "en";
396 pluralMode = PluralMode.MODE_NOTONE;
397 return true;
398 }
399 URL en = getTranslationFile("en");
400 if (en == null)
401 return false;
402 URL tr = getTranslationFile(l);
403 if (tr == null || !languages.containsKey(l)) {
404 return false;
405 }
406 try (
407 InputStream enStream = Utils.openStream(en);
408 InputStream trStream = Utils.openStream(tr)
409 ) {
410 if (load(enStream, trStream, false)) {
411 pluralMode = languages.get(l);
412 loadedCode = l;
413 return true;
414 }
415 } catch (IOException e) {
416 // Ignore exception
417 Logging.trace(e);
418 }
419 return false;
420 }
421
422 private static boolean load(InputStream en, InputStream tr, boolean add) {
423 Map<String, String> s;
424 Map<String, String[]> p;
425 if (add) {
426 s = strings;
427 p = pstrings;
428 } else {
429 s = new HashMap<>();
430 p = new HashMap<>();
431 }
432 /* file format:
433 Files are always a group. English file and translated file must provide identical datasets.
434
435 for all single strings:
436 {
437 unsigned short (2 byte) stringlength
438 - length 0 indicates missing translation
439 - length 0xFFFE indicates translation equal to original, but otherwise is equal to length 0
440 string
441 }
442 unsigned short (2 byte) 0xFFFF (marks end of single strings)
443 for all multi strings:
444 {
445 unsigned char (1 byte) stringcount
446 - count 0 indicates missing translations
447 - count 0xFE indicates translations equal to original, but otherwise is equal to length 0
448 for stringcount
449 unsigned short (2 byte) stringlength
450 string
451 }
452 */
453 try {
454 InputStream ens = new BufferedInputStream(en);
455 InputStream trs = new BufferedInputStream(tr);
456 byte[] enlen = new byte[2];
457 byte[] trlen = new byte[2];
458 boolean multimode = false;
459 byte[] str = new byte[4096];
460 for (;;) {
461 if (multimode) {
462 int ennum = ens.read();
463 int trnum = trs.read();
464 if (trnum == 0xFE) /* marks identical string, handle equally to non-translated */
465 trnum = 0;
466 if ((ennum == -1 && trnum != -1) || (ennum != -1 && trnum == -1)) /* files do not match */
467 return false;
468 if (ennum == -1) {
469 break;
470 }
471 String[] enstrings = new String[ennum];
472 for (int i = 0; i < ennum; ++i) {
473 int val = ens.read(enlen);
474 if (val != 2) /* file corrupt */
475 return false;
476 val = (enlen[0] < 0 ? 256+enlen[0] : enlen[0])*256+(enlen[1] < 0 ? 256+enlen[1] : enlen[1]);
477 if (val > str.length) {
478 str = new byte[val];
479 }
480 int rval = ens.read(str, 0, val);
481 if (rval != val) /* file corrupt */
482 return false;
483 enstrings[i] = new String(str, 0, val, StandardCharsets.UTF_8);
484 }
485 String[] trstrings = new String[trnum];
486 for (int i = 0; i < trnum; ++i) {
487 int val = trs.read(trlen);
488 if (val != 2) /* file corrupt */
489 return false;
490 val = (trlen[0] < 0 ? 256+trlen[0] : trlen[0])*256+(trlen[1] < 0 ? 256+trlen[1] : trlen[1]);
491 if (val > str.length) {
492 str = new byte[val];
493 }
494 int rval = trs.read(str, 0, val);
495 if (rval != val) /* file corrupt */
496 return false;
497 trstrings[i] = new String(str, 0, val, StandardCharsets.UTF_8);
498 }
499 if (trnum > 0 && !p.containsKey(enstrings[0])) {
500 p.put(enstrings[0], trstrings);
501 }
502 } else {
503 int enval = ens.read(enlen);
504 int trval = trs.read(trlen);
505 if (enval != trval) /* files do not match */
506 return false;
507 if (enval == -1) {
508 break;
509 }
510 if (enval != 2) /* files corrupt */
511 return false;
512 enval = (enlen[0] < 0 ? 256+enlen[0] : enlen[0])*256+(enlen[1] < 0 ? 256+enlen[1] : enlen[1]);
513 trval = (trlen[0] < 0 ? 256+trlen[0] : trlen[0])*256+(trlen[1] < 0 ? 256+trlen[1] : trlen[1]);
514 if (trval == 0xFFFE) /* marks identical string, handle equally to non-translated */
515 trval = 0;
516 if (enval == 0xFFFF) {
517 multimode = true;
518 if (trval != 0xFFFF) /* files do not match */
519 return false;
520 } else {
521 if (enval > str.length) {
522 str = new byte[enval];
523 }
524 if (trval > str.length) {
525 str = new byte[trval];
526 }
527 int val = ens.read(str, 0, enval);
528 if (val != enval) /* file corrupt */
529 return false;
530 String enstr = new String(str, 0, enval, StandardCharsets.UTF_8);
531 if (trval != 0) {
532 val = trs.read(str, 0, trval);
533 if (val != trval) /* file corrupt */
534 return false;
535 String trstr = new String(str, 0, trval, StandardCharsets.UTF_8);
536 if (!s.containsKey(enstr))
537 s.put(enstr, trstr);
538 }
539 }
540 }
541 }
542 } catch (IOException e) {
543 Logging.trace(e);
544 return false;
545 }
546 if (!s.isEmpty()) {
547 strings = s;
548 pstrings = p;
549 return true;
550 }
551 return false;
552 }
553
554 /**
555 * Sets the default locale (see {@link Locale#setDefault(Locale)} to the local
556 * given by <code>localName</code>.
557 *
558 * Ignored if localeName is null. If the locale with name <code>localName</code>
559 * isn't found the default local is set to <code>en</code> (english).
560 *
561 * @param localeName the locale name. Ignored if null.
562 */
563 public static void set(String localeName) {
564 if (localeName != null) {
565 Locale l = LanguageInfo.getLocale(localeName);
566 if (load(LanguageInfo.getJOSMLocaleCode(l))) {
567 Locale.setDefault(l);
568 } else {
569 if (!"en".equals(l.getLanguage())) {
570 Logging.info(tr("Unable to find translation for the locale {0}. Reverting to {1}.",
571 LanguageInfo.getDisplayName(l), LanguageInfo.getDisplayName(Locale.getDefault())));
572 } else {
573 strings = null;
574 pstrings = null;
575 }
576 }
577 }
578 }
579
580 private static int pluralEval(long n) {
581 switch(pluralMode) {
582 case MODE_NOTONE: /* bg, da, de, el, en, en_GB, es, et, eu, fi, gl, is, it, iw_IL, nb, nl, sv */
583 return (n != 1) ? 1 : 0;
584 case MODE_NONE: /* id, vi, ja, km, tr, zh_CN, zh_TW */
585 return 0;
586 case MODE_GREATERONE: /* fr, pt_BR */
587 return (n > 1) ? 1 : 0;
588 case MODE_CS:
589 return (n == 1) ? 0 : (((n >= 2) && (n <= 4)) ? 1 : 2);
590 //case MODE_AR:
591 // return ((n == 0) ? 0 : ((n == 1) ? 1 : ((n == 2) ? 2 : ((((n % 100) >= 3)
592 // && ((n % 100) <= 10)) ? 3 : ((((n % 100) >= 11) && ((n % 100) <= 99)) ? 4 : 5)))));
593 case MODE_PL:
594 return (n == 1) ? 0 : (((((n % 10) >= 2) && ((n % 10) <= 4))
595 && (((n % 100) < 10) || ((n % 100) >= 20))) ? 1 : 2);
596 //case MODE_RO:
597 // return ((n == 1) ? 0 : ((((n % 100) > 19) || (((n % 100) == 0) && (n != 0))) ? 2 : 1));
598 case MODE_LT:
599 return ((n % 10) == 1) && ((n % 100) != 11) ? 0 : (((n % 10) >= 2)
600 && (((n % 100) < 10) || ((n % 100) >= 20)) ? 1 : 2);
601 case MODE_RU:
602 return (((n % 10) == 1) && ((n % 100) != 11)) ? 0 : (((((n % 10) >= 2)
603 && ((n % 10) <= 4)) && (((n % 100) < 10) || ((n % 100) >= 20))) ? 1 : 2);
604 case MODE_SK:
605 return (n == 1) ? 1 : (((n >= 2) && (n <= 4)) ? 2 : 0);
606 //case MODE_SL:
607 // return (((n % 100) == 1) ? 1 : (((n % 100) == 2) ? 2 : ((((n % 100) == 3)
608 // || ((n % 100) == 4)) ? 3 : 0)));
609 }
610 return 0;
611 }
612}
Note: See TracBrowser for help on using the repository browser.