mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-04 16:35:08 -05:00
* more resilient error handling in case of illegal user locale
This commit is contained in:
parent
b509f108d0
commit
f7c2d8eb69
@ -67,7 +67,7 @@ public class Language {
|
|||||||
try {
|
try {
|
||||||
return new Language(code, bundle.getString(code + ".name"));
|
return new Language(code, bundle.getString(code + ".name"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return null;
|
return new Language(code, new Locale(code).getDisplayLanguage(Locale.ROOT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +235,9 @@ public class RenamePanel extends JComponent {
|
|||||||
@Override
|
@Override
|
||||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||||
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||||
|
if (value != null) {
|
||||||
setIcon(ResourceManager.getFlagIcon(((Language) value).getCode()));
|
setIcon(ResourceManager.getFlagIcon(((Language) value).getCode()));
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user