* force ISO3 letter-language code
This commit is contained in:
parent
5d5902cdfb
commit
e654be95a5
|
@ -295,8 +295,8 @@ public class MediaBindingBean {
|
|||
|
||||
Locale languageSuffix = new ReleaseInfo().getLanguageSuffix(FileUtilities.getName(mediaFile));
|
||||
if (languageSuffix != null)
|
||||
return languageSuffix;
|
||||
|
||||
return new Locale(languageSuffix.getISO3Language()); // force ISO3 letter-code
|
||||
|
||||
// require subtitle file
|
||||
if (!SUBTITLE_FILES.accept(mediaFile))
|
||||
return null;
|
||||
|
|
|
@ -53,6 +53,7 @@ public class ReleaseInfo {
|
|||
public Locale getLanguageSuffix(String name) {
|
||||
// match locale identifier and lookup Locale object
|
||||
Map<String, Locale> languages = getLanguageMap(Locale.ENGLISH, Locale.getDefault());
|
||||
|
||||
String lang = matchLast(getLanguageSuffixPattern(languages.keySet()), null, name);
|
||||
if (lang == null)
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue