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());
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);
if (language != null) {
return language.getISO3().equalsIgnoreCase(languageCode);

View File

@ -539,7 +539,7 @@ public class MediaBindingBean {
@Define("lang")
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) {
return Language.getLanguage(languageSuffix);
}

View File

@ -111,7 +111,7 @@ public class MediaDetection {
}
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);
@ -1089,7 +1089,7 @@ public class MediaDetection {
// allow extended extensions for subtitles files, for example name.eng.srt => map by en.srt
if (key != null && SUBTITLE_FILES.accept(file)) {
Locale locale = releaseInfo.getLanguageTag(getName(file));
Locale locale = releaseInfo.getSubtitleLanguageTag(getName(file));
if (locale != null) {
key = locale.getLanguage() + '.' + key;
}

View File

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