本文整理汇总了Java中org.languagetool.Language.LANGUAGES属性的典型用法代码示例。如果您正苦于以下问题:Java Language.LANGUAGES属性的具体用法?Java Language.LANGUAGES怎么用?Java Language.LANGUAGES使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.languagetool.Language
的用法示例。
在下文中一共展示了Language.LANGUAGES属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPossibleMotherTongues
private Object[] getPossibleMotherTongues() {
final List<Object> motherTongues = new ArrayList<Object>();
motherTongues.add(NO_MOTHER_TONGUE);
for (final Language lang : Language.LANGUAGES) {
if (lang != Language.DEMO)
motherTongues.add(messages.getString(lang.getShortName()));
}
return motherTongues.toArray();
}
示例2: getLanguageForLocalizedName
/**
* Get the Language object for the given localized language name.
*
* @param languageName e.g. <code>English</code> or <code>German</code> (case is significant)
* @return a Language object or <code>null</code>
*/
private Language getLanguageForLocalizedName(final String languageName) {
for (final Language element : Language.LANGUAGES) {
if (NO_MOTHER_TONGUE.equals(languageName))
return Language.DEMO;
if (languageName.equals(messages.getString(element.getShortName())))
return element;
}
return null;
}
示例3: getAllLanguages
private List<I18nLanguage> getAllLanguages() {
final List<I18nLanguage> i18nLanguages = new ArrayList<I18nLanguage>();
for (Language language : Language.LANGUAGES) {
if (language != Language.DEMO)
i18nLanguages.add(new I18nLanguage(language, messages));
}
Collections.sort(i18nLanguages);
return i18nLanguages;
}