This commit is contained in:
Reinhard Pointner 2016-03-24 15:21:36 +00:00
parent 5bc9a3737c
commit 439ebe322b
4 changed files with 5 additions and 5 deletions

View File

@ -778,7 +778,7 @@ public class CmdlineOperations implements CmdlineInterface {
private final String languageCode = Language.getStandardLanguageCode(getLanguage(languageName).getName()); private final String languageCode = Language.getStandardLanguageCode(getLanguage(languageName).getName());
public boolean matchesLanguageCode(File f) { public boolean matchesLanguageCode(File f) {
Locale languageSuffix = MediaDetection.releaseInfo.getLanguageTag(FileUtilities.getName(f)); Locale languageSuffix = MediaDetection.releaseInfo.getSubtitleLanguageTag(FileUtilities.getName(f));
Language language = Language.getLanguage(languageSuffix); Language language = Language.getLanguage(languageSuffix);
if (language != null) { if (language != null) {
return language.getISO3().equalsIgnoreCase(languageCode); return language.getISO3().equalsIgnoreCase(languageCode);

View File

@ -539,7 +539,7 @@ public class MediaBindingBean {
@Define("lang") @Define("lang")
public Language getLanguageTag() throws Exception { public Language getLanguageTag() throws Exception {
Locale languageSuffix = releaseInfo.getLanguageTag(FileUtilities.getName(getMediaFile()), getOriginalFileName(getMediaFile())); Locale languageSuffix = releaseInfo.getSubtitleLanguageTag(FileUtilities.getName(getMediaFile()), getOriginalFileName(getMediaFile()));
if (languageSuffix != null) { if (languageSuffix != null) {
return Language.getLanguage(languageSuffix); return Language.getLanguage(languageSuffix);
} }

View File

@ -111,7 +111,7 @@ public class MediaDetection {
} }
public static Locale guessLanguageFromSuffix(File file) { public static Locale guessLanguageFromSuffix(File file) {
return releaseInfo.getLanguageTag(getName(file)); return releaseInfo.getSubtitleLanguageTag(getName(file));
} }
private static final SeasonEpisodeMatcher seasonEpisodeMatcherStrict = new SmartSeasonEpisodeMatcher(SeasonEpisodeMatcher.DEFAULT_SANITY, true); private static final SeasonEpisodeMatcher seasonEpisodeMatcherStrict = new SmartSeasonEpisodeMatcher(SeasonEpisodeMatcher.DEFAULT_SANITY, true);
@ -1089,7 +1089,7 @@ public class MediaDetection {
// allow extended extensions for subtitles files, for example name.eng.srt => map by en.srt // allow extended extensions for subtitles files, for example name.eng.srt => map by en.srt
if (key != null && SUBTITLE_FILES.accept(file)) { if (key != null && SUBTITLE_FILES.accept(file)) {
Locale locale = releaseInfo.getLanguageTag(getName(file)); Locale locale = releaseInfo.getSubtitleLanguageTag(getName(file));
if (locale != null) { if (locale != null) {
key = locale.getLanguage() + '.' + key; key = locale.getLanguage() + '.' + key;
} }

View File

@ -112,7 +112,7 @@ public class ReleaseInfo {
private Pattern languageTag; private Pattern languageTag;
public Locale getLanguageTag(CharSequence... name) { public Locale getSubtitleLanguageTag(CharSequence... name) {
// match locale identifier and lookup Locale object // match locale identifier and lookup Locale object
if (languageTag == null) { if (languageTag == null) {
languageTag = getSubtitleLanguageTagPattern(getDefaultLanguageMap().keySet()); languageTag = getSubtitleLanguageTagPattern(getDefaultLanguageMap().keySet());