Skip to content

Commit ed3efb3

Browse files
author
Dmitry Trusevich
committed
fix locale comparison
1 parent 79cb215 commit ed3efb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

basics/src/main/java/com/itextpdf/basics/ResourceLocaleBundle.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
public class ResourceLocaleBundle {
1414

1515
public final static Locale DEFAULT_LOCALE = Locale.ENGLISH;
16-
public final static Set<Locale> locales = new HashSet(Arrays.asList(Locale.ENGLISH, new Locale("pt_PT"), new Locale("nl_NL")));
16+
public final static Set<String> locales = new HashSet(Arrays.asList("en", "pt", "nl"));
1717
private final static String RESOURCE_BUNDLE_ERROR_MESSAGE = "Exception message {0} is not found in the file";
1818

1919

2020
public synchronized static String getMessage(String path, String key, List<Object> args) {
2121
Locale currentLocale = Locale.getDefault();
22-
if (!locales.equals(locales)) {
22+
if (!locales.contains(currentLocale.getLanguage())) {
2323
currentLocale = DEFAULT_LOCALE;
2424
}
2525
ResourceBundle bundle = ResourceBundle.getBundle(path, currentLocale);

0 commit comments

Comments
 (0)