1
0
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:
Reinhard Pointner 2012-03-02 04:51:19 +00:00
parent b509f108d0
commit f7c2d8eb69
2 changed files with 18 additions and 16 deletions

View File

@ -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));
} }
} }

View File

@ -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;
} }
}); });