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