Permalink
Browse files

Fixes locales list in the "translate" command's help text

  • Loading branch information...
joeha480 committed Nov 7, 2017
1 parent d7e0c65 commit f14db9716823df7e65a09a30f8a8d29fa3235c6d
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/org/daisy/dotify/cli/TranslateCLI.java
@@ -7,6 +7,7 @@
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
import org.daisy.braille.utils.api.factory.Factory;
import org.daisy.braille.utils.api.factory.FactoryCatalog;
@@ -46,12 +47,12 @@ public TranslateCLI() {
for (FactoryProperties p : tableCatalog.list()) { idents.add(p.getIdentifier()); }
tableSF = new ShortFormResolver(idents);
Collection<TranslatorSpecification> tr = BrailleTranslatorFactoryMaker.newInstance().listSpecifications();
ArrayList<Definition> translations = new ArrayList<Definition>();
for (TranslatorSpecification ts : tr) {
if (!BrailleTranslatorFactory.MODE_BYPASS.equals(ts.getMode())) {
translations.add(new Definition(ts.getLocale(), ""));
}
}
List<Definition> translations = tr.stream()
.filter(v->v.getMode()!=BrailleTranslatorFactory.MODE_BYPASS)
.map(v->v.getLocale())
.distinct()
.map(v->new Definition(v, ""))
.collect(Collectors.toList());
this.optionalArgs = new ArrayList<OptionalArgument>();
optionalArgs.add(new OptionalArgument(LOCALE_KEY, "Braille locale. Note that the default locale is based on system settings, not on available braille locales.", translations, DEFAULT_LOCALE));
optionalArgs.add(new OptionalArgument(TABLE_KEY, "Table to use", getDefinitionList(tableCatalog, tableSF), "unicode_braille"));

0 comments on commit f14db97

Please sign in to comment.