Search in sources :

Example 1 with Message

use of com.djrapitops.plan.settings.locale.Message in project Plan by plan-player-analytics.

the class ActivityIndexTest method createTestLocale.

private Locale createTestLocale() {
    Locale locale = new Locale();
    locale.put(HtmlLang.INDEX_VERY_ACTIVE, new Message("A"));
    locale.put(HtmlLang.INDEX_ACTIVE, new Message("B"));
    locale.put(HtmlLang.INDEX_REGULAR, new Message("C"));
    locale.put(HtmlLang.INDEX_IRREGULAR, new Message("D"));
    locale.put(HtmlLang.INDEX_INACTIVE, new Message("E"));
    return locale;
}
Also used : Locale(com.djrapitops.plan.settings.locale.Locale) Message(com.djrapitops.plan.settings.locale.Message)

Example 2 with Message

use of com.djrapitops.plan.settings.locale.Message in project Plan by plan-player-analytics.

the class ComparatorTest method localeEntryComparator.

@Test
void localeEntryComparator() {
    Map<Lang, Message> messageMap = new HashMap<>();
    messageMap.put(HelpLang.SERVERS, new Message(RandomData.randomString(10)));
    messageMap.put(HelpLang.SERVER, new Message(RandomData.randomString(10)));
    messageMap.put(HelpLang.DB_RESTORE, new Message(RandomData.randomString(10)));
    List<Lang> result = messageMap.entrySet().stream().sorted(new LocaleEntryComparator()).map(Map.Entry::getKey).collect(Collectors.toList());
    List<Lang> expected = Arrays.asList(HelpLang.DB_RESTORE, HelpLang.SERVER, HelpLang.SERVERS);
    assertEquals(expected, result);
}
Also used : Message(com.djrapitops.plan.settings.locale.Message) HelpLang(com.djrapitops.plan.settings.locale.lang.HelpLang) Lang(com.djrapitops.plan.settings.locale.lang.Lang) Test(org.junit.jupiter.api.Test)

Aggregations

Message (com.djrapitops.plan.settings.locale.Message)2 Locale (com.djrapitops.plan.settings.locale.Locale)1 HelpLang (com.djrapitops.plan.settings.locale.lang.HelpLang)1 Lang (com.djrapitops.plan.settings.locale.lang.Lang)1 Test (org.junit.jupiter.api.Test)1