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
043c7315
Commit
043c7315
authored
May 06, 2022
by
KingRainbow44
Browse files
Fix for translation errors
parent
f3410092
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/Grasscutter.java
View file @
043c7315
...
@@ -93,7 +93,7 @@ public final class Grasscutter {
...
@@ -93,7 +93,7 @@ public final class Grasscutter {
ResourceLoader
.
loadAll
();
ResourceLoader
.
loadAll
();
ScriptLoader
.
init
();
ScriptLoader
.
init
();
//
D
atabase
//
Initialize d
atabase
.
DatabaseManager
.
initialize
();
DatabaseManager
.
initialize
();
// Create server instances.
// Create server instances.
...
...
src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java
View file @
043c7315
...
@@ -334,7 +334,7 @@ public final class DispatchServer {
...
@@ -334,7 +334,7 @@ public final class DispatchServer {
return
;
return
;
}
}
LoginResultJson
responseData
=
new
LoginResultJson
();
LoginResultJson
responseData
=
new
LoginResultJson
();
Grasscutter
.
getLogger
().
info
(
translate
(
"messages.dispatch.account.login_token_attempt"
));
Grasscutter
.
getLogger
().
info
(
translate
(
"messages.dispatch.account.login_token_attempt"
,
req
.
ip
()
));
// Login
// Login
Account
account
=
DatabaseHelper
.
getAccountById
(
requestData
.
uid
);
Account
account
=
DatabaseHelper
.
getAccountById
(
requestData
.
uid
);
...
...
src/main/java/emu/grasscutter/utils/Language.java
View file @
043c7315
...
@@ -29,7 +29,13 @@ public final class Language {
...
@@ -29,7 +29,13 @@ public final class Language {
* @return A translated value with arguments substituted.
* @return A translated value with arguments substituted.
*/
*/
public
static
String
translate
(
String
key
,
Object
...
args
)
{
public
static
String
translate
(
String
key
,
Object
...
args
)
{
return
Grasscutter
.
getLanguage
().
get
(
key
).
formatted
(
args
);
String
translated
=
Grasscutter
.
getLanguage
().
get
(
key
);
try
{
return
translated
.
formatted
(
args
);
}
catch
(
Exception
exception
)
{
Grasscutter
.
getLogger
().
error
(
"Failed to format string: "
+
key
,
exception
);
return
translated
;
}
}
}
/**
/**
...
...
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