diff --git a/source/net/sourceforge/filebot/cli/ArgumentBean.java b/source/net/sourceforge/filebot/cli/ArgumentBean.java index a14a7ad8..1fa5d382 100644 --- a/source/net/sourceforge/filebot/cli/ArgumentBean.java +++ b/source/net/sourceforge/filebot/cli/ArgumentBean.java @@ -99,10 +99,18 @@ public class ArgumentBean { public Language getLanguage() { + // try to look up by language code Language language = Language.getLanguage(lang); - if (language == null) - throw new IllegalArgumentException("Illegal language code: " + lang); + if (language == null) { + // try too look up by language name + language = Language.getLanguageByName(lang); + + if (language == null) { + // unable to lookup language + throw new IllegalArgumentException("Illegal language code: " + lang); + } + } return language; } diff --git a/source/net/sourceforge/filebot/ui/Language.java b/source/net/sourceforge/filebot/ui/Language.java index 2cdfd7e1..7730891d 100644 --- a/source/net/sourceforge/filebot/ui/Language.java +++ b/source/net/sourceforge/filebot/ui/Language.java @@ -83,6 +83,16 @@ public class Language { } + public static Language getLanguageByName(String name) { + for (Language it : availableLanguages()) { + if (name.equalsIgnoreCase(it.getName())) + return it; + } + + return null; + } + + public static List availableLanguages() { ResourceBundle bundle = ResourceBundle.getBundle(Language.class.getName()); return getLanguages(bundle.getString("languages.all").split(",")); diff --git a/website/cli.html b/website/cli.html index 49e0ad66..6d5db93e 100644 --- a/website/cli.html +++ b/website/cli.html @@ -144,7 +144,7 @@ -non-strict use less strict matching - (off by default) + (strict by default) -get-subtitles @@ -158,7 +158,7 @@ --lang - 2-letter language code + 2-letter language code en, de, fr, es, ja, zh, etc @@ -192,7 +192,12 @@ -clear - clear cache and settings + clear cache and preferences + + + + -no-analytics + disable analytics