Skip to content

Commit 32b8177

Browse files
committed
[skip ci] Add .editorconfig
1 parent 9a03e97 commit 32b8177

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.java]
2+
ij_continuation_indent_size = 4
3+
ij_any_keep_simple_classes_in_one_line = true
4+
insert_final_newline = true

common/src/main/java/dev/booky/cloudcore/i18n/CloudTranslator.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)