diff --git a/javase/src/com/google/zxing/HtmlAssetTranslator.java b/javase/src/com/google/zxing/HtmlAssetTranslator.java index f4d1737f9..72ee6ec50 100644 --- a/javase/src/com/google/zxing/HtmlAssetTranslator.java +++ b/javase/src/com/google/zxing/HtmlAssetTranslator.java @@ -37,6 +37,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.LinkedList; +import java.util.List; import java.util.Queue; import java.util.regex.Pattern; @@ -44,15 +45,17 @@ import java.util.regex.Pattern; *
A utility which auto-translates the English-language text in a directory of HTML documents using * Google Translate.
* - *Pass the Android client assets/ directory as first argument, and the language to translate to second. - * Specify "all" for language to try to translate for all existing translations. - * Optionally, you can specify the files to translate individually. - * Usage: {@code HtmlAssetTranslator android/assets/ es [file1.html file2.html ...]}
+ *Pass the Android client assets/ directory as first argument, and the language to translate to second + * as a comma-separated list. Specify "all" for language to try to translate for all existing translations. + * Each argument after this is the name of a file to translate; if the first one is "all", all files will + * be translated.
+ * + *Usage: {@code HtmlAssetTranslator android/assets/ (all|lang1[,lang2 ...]) (all|file1.html[ file2.html ...])}
* - *This will translate .html files in subdirectory html-en to directory html-es, for example. - * Note that only text nodes in the HTML document are translated. Any text that is a child of a node - * with {@code class="notranslate"} will not be translated. It will also add a note at the end of - * the translated page that indicates it was automatically translated.
+ *{@code android/assets/ es all} will translate .html files in subdirectory html-en to + * directory html-es, for example. Note that only text nodes in the HTML document are translated. + * Any text that is a child of a node with {@code class="notranslate"} will not be translated. It will + * also add a note at the end of the translated page that indicates it was automatically translated.
* * @author Sean Owen */ @@ -63,16 +66,21 @@ public final class HtmlAssetTranslator { private HtmlAssetTranslator() {} public static void main(String[] args) throws IOException { + if (args.length < 3) { + System.err.println("Usage: HtmlAssetTranslator android/assets/ " + + "(all|lang1[,lang2 ...]) (all|file1.html[ file2.html ...])"); + return; + } File assetsDir = new File(args[0]); Collection