Revision 28461 trunk/extensions/extI18n/src/org/gvsig/i18n/impl/ExportLocaleException.java
ExportLocaleException.java | ||
---|---|---|
39 | 39 |
|
40 | 40 |
private static final long serialVersionUID = -1386427767068278421L; |
41 | 41 |
|
42 |
private static final String MSG = "Unable to export the locale"; |
|
42 |
private static final String MSG = "Unable to export the locales";
|
|
43 | 43 |
|
44 | 44 |
private static final String KEY = "_ExportLocaleException"; |
45 | 45 |
|
46 |
private final Locale locale;
|
|
46 |
private final Locale[] locales;
|
|
47 | 47 |
|
48 |
public ExportLocaleException(Locale locale) {
|
|
48 |
public ExportLocaleException(Locale[] locales) {
|
|
49 | 49 |
super(MSG, KEY); |
50 |
this.locale = locale;
|
|
50 |
this.locales = locales;
|
|
51 | 51 |
} |
52 | 52 |
|
53 |
public ExportLocaleException(Locale locale, Throwable cause) {
|
|
53 |
public ExportLocaleException(Locale[] locales, Throwable cause) {
|
|
54 | 54 |
super(MSG, KEY, cause); |
55 |
this.locale = locale;
|
|
55 |
this.locales = locales;
|
|
56 | 56 |
} |
57 | 57 |
|
58 | 58 |
public String getLocalizedMessage() { |
59 |
return super.getLocalizedMessage() + ": " + locale; |
|
59 |
StringBuffer buffer = new StringBuffer(); |
|
60 |
if (locales != null) { |
|
61 |
int i = 0; |
|
62 |
for (; i < locales.length - 1; i++) { |
|
63 |
buffer.append(locales[i]).append(','); |
|
64 |
} |
|
65 |
buffer.append(locales[i]); |
|
66 |
} |
|
67 |
return super.getLocalizedMessage() + ": " + buffer.toString(); |
|
60 | 68 |
} |
61 | 69 |
} |
Also available in: Unified diff