* improved docs

This commit is contained in:
Reinhard Pointner 2011-09-22 12:24:10 +00:00
parent d80e5683d5
commit ba622eafd1
3 changed files with 28 additions and 5 deletions

View File

@ -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;
}

View File

@ -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<Language> availableLanguages() {
ResourceBundle bundle = ResourceBundle.getBundle(Language.class.getName());
return getLanguages(bundle.getString("languages.all").split(","));

View File

@ -144,7 +144,7 @@
<tr>
<td>-non-strict</td>
<td>use less strict matching</td>
<td><small class="comment">(off by default)</small></td>
<td><small class="comment">(strict by default)</small></td>
</tr>
<tr>
<td>-get-subtitles</td>
@ -158,7 +158,7 @@
</tr>
<tr>
<td>--lang</td>
<td><a href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes">2-letter language code</a></td>
<td><a href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes" target="_blank">2-letter language code</a></td>
<td>en, de, fr, es, ja, zh, etc</td>
</tr>
<tr>
@ -192,7 +192,12 @@
</tr>
<tr>
<td>-clear</td>
<td>clear cache and settings</td>
<td>clear cache and preferences</td>
<td></td>
</tr>
<tr>
<td>-no-analytics</td>
<td>disable <a href="https://sourceforge.net/projects/filebot/forums/forum/723389/topic/4719727" target="_blank">analytics</a></td>
<td></td>
</tr>
<tr>