@@ -36,17 +36,17 @@ public final class CloudTranslator implements Translator {
3636 private Map <String , Translation > translations ;
3737
3838 public CloudTranslator (
39- ClassLoader classLoader ,
40- Keyed translatorName ,
41- Locale ... locales
39+ ClassLoader classLoader ,
40+ Keyed translatorName ,
41+ Locale ... locales
4242 ) {
4343 this (classLoader , translatorName , List .of (locales ));
4444 }
4545
4646 public CloudTranslator (
47- ClassLoader classLoader ,
48- Keyed translatorName ,
49- Collection <Locale > locales
47+ ClassLoader classLoader ,
48+ Keyed translatorName ,
49+ Collection <Locale > locales
5050 ) {
5151 if (locales .isEmpty ()) {
5252 throw new IllegalArgumentException ("At least one locale has to be provided" );
@@ -97,21 +97,21 @@ private void load0() {
9797 }
9898
9999 this .translations = rawTranslations .entrySet ().stream ()
100- // flatten raw translations
101- .flatMap (rawEntry -> rawEntry .getValue ().entrySet ().stream ()
102- .map (entry -> Map .entry (entry .getKey (),
103- Map .entry (rawEntry .getKey (), entry .getValue ()))))
104- // group by translation key
105- .collect (Collectors .toMap (
106- Map .Entry ::getKey ,
107- entry -> Stream .of (entry .getValue ()),
108- Stream ::concat
109- ))
110- .entrySet ().stream ()
111- // create translation objects and collect them
100+ // flatten raw translations
101+ .flatMap (rawEntry -> rawEntry .getValue ().entrySet ().stream ()
112102 .map (entry -> Map .entry (entry .getKey (),
113- new Translation (this , entry .getValue ())))
114- .collect (Collectors .toUnmodifiableMap (Map .Entry ::getKey , Map .Entry ::getValue ));
103+ Map .entry (rawEntry .getKey (), entry .getValue ()))))
104+ // group by translation key
105+ .collect (Collectors .toMap (
106+ Map .Entry ::getKey ,
107+ entry -> Stream .of (entry .getValue ()),
108+ Stream ::concat
109+ ))
110+ .entrySet ().stream ()
111+ // create translation objects and collect them
112+ .map (entry -> Map .entry (entry .getKey (),
113+ new Translation (this , entry .getValue ())))
114+ .collect (Collectors .toUnmodifiableMap (Map .Entry ::getKey , Map .Entry ::getValue ));
115115
116116 // add as global translator source after loading
117117 GlobalTranslator .translator ().addSource (this );
0 commit comments