Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
d7af52f9
Commit
d7af52f9
authored
Oct 29, 2022
by
AnimeGitB
Browse files
Don't override en-us gacha strings with vietnamese
parent
c21d216d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/tools/Tools.java
View file @
d7af52f9
...
...
@@ -232,10 +232,14 @@ public final class Tools {
public
static
void
createGachaMappings
(
Path
location
)
throws
IOException
{
ResourceLoader
.
loadResources
();
List
<
String
>
jsons
=
createGachaMappingJsons
();
var
usedLocales
=
new
HashSet
<
String
>();
StringBuilder
sb
=
new
StringBuilder
(
"mappings = {\n"
);
for
(
int
i
=
0
;
i
<
Language
.
TextStrings
.
NUM_LANGUAGES
;
i
++)
{
sb
.
append
(
"\t\"%s\": "
.
formatted
(
Language
.
TextStrings
.
ARR_GC_LANGUAGES
[
i
].
toLowerCase
()));
// TODO: change the templates to not use lowercased locale codes
sb
.
append
(
jsons
.
get
(
i
).
replace
(
"\n"
,
"\n\t"
)
+
",\n"
);
String
locale
=
Language
.
TextStrings
.
ARR_GC_LANGUAGES
[
i
].
toLowerCase
();
// TODO: change the templates to not use lowercased locale codes
if
(
usedLocales
.
add
(
locale
))
{
// Some locales fallback to en-us, we don't want to redefine en-us with vietnamese strings
sb
.
append
(
"\t\"%s\": "
.
formatted
(
locale
));
sb
.
append
(
jsons
.
get
(
i
).
replace
(
"\n"
,
"\n\t"
)
+
",\n"
);
}
}
sb
.
setLength
(
sb
.
length
()
-
2
);
// Delete trailing ",\n"
sb
.
append
(
"\n}"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment