* only detect English language names (some special chars in french seem to break the regex... nvmd)

This commit is contained in:
Reinhard Pointner 2012-02-08 12:57:22 +00:00
parent ed5f97dbed
commit 46b6d96160
1 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,6 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@ -113,7 +112,7 @@ public class ReleaseInfo {
public Pattern getLanguageSuffixPattern() {
// .{language}[.srt]
return compile("(?<=\\p{Punct}|\\s)(" + join(getLanguageMap(Locale.ENGLISH, Locale.getDefault()).keySet(), "|") + ")(?=$)", CASE_INSENSITIVE | UNICODE_CASE | CANON_EQ);
return compile("(?<=\\p{Punct}|\\s)(" + join(getLanguageMap(Locale.ENGLISH).keySet(), "|") + ")(?=$)", CASE_INSENSITIVE | UNICODE_CASE | CANON_EQ);
}
@ -126,7 +125,7 @@ public class ReleaseInfo {
languageMap.put(locale.getISO3Language(), locale);
// map display language names for given locales
for (Locale language : new HashSet<Locale>(asList(supportedLanguageName))) {
for (Locale language : asList(supportedLanguageName)) {
languageMap.put(locale.getDisplayLanguage(language), locale);
}
}