Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
b12b31c3
Commit
b12b31c3
authored
May 16, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复等待时间
parent
ab031ccf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
YzgLanguage.java
...rc/main/java/com/yanzuoguang/util/helper/YzgLanguage.java
+11
-11
CheckHelperTest.java
yzg-util-base/src/test/java/helper/CheckHelperTest.java
+2
-2
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/YzgLanguage.java
View file @
b12b31c3
...
...
@@ -36,7 +36,7 @@ public class YzgLanguage {
/**
* 默认场景
*/
public
static
final
String
SCENE_G
lobal
=
"GLOBAL"
;
public
static
final
String
SCENE_G
LOBAL
=
"GLOBAL"
;
/**
* 英语
...
...
@@ -49,7 +49,7 @@ public class YzgLanguage {
/**
* 整个系统默认语言
*/
private
String
defaulLanguage
=
LANGUAGE_EN
;
private
String
defaul
t
Language
=
LANGUAGE_EN
;
/**
* 当前线程默认语言
*/
...
...
@@ -67,10 +67,10 @@ public class YzgLanguage {
/**
* 设置默认语言,默认为英语(en)
*
* @param defaulLanguage
* @param defaul
t
Language
*/
public
YzgLanguage
setDefaul
Language
(
String
defaul
Language
)
{
this
.
defaul
Language
=
defaul
Language
;
public
YzgLanguage
setDefaul
tLanguage
(
String
default
Language
)
{
this
.
defaul
tLanguage
=
default
Language
;
return
this
;
}
...
...
@@ -79,8 +79,8 @@ public class YzgLanguage {
*
* @return
*/
public
String
getDefaulLanguage
()
{
return
defaulLanguage
;
public
String
getDefaul
t
Language
()
{
return
defaul
t
Language
;
}
...
...
@@ -111,7 +111,7 @@ public class YzgLanguage {
* @return
*/
public
String
getLanguage
()
{
return
StringHelper
.
getFirst
(
this
.
threadLanguage
.
get
(),
defaulLanguage
);
return
StringHelper
.
getFirst
(
this
.
threadLanguage
.
get
(),
defaul
t
Language
);
}
/**
...
...
@@ -141,7 +141,7 @@ public class YzgLanguage {
* @return
*/
public
String
getScene
()
{
return
StringHelper
.
getFirst
(
this
.
threadScene
.
get
(),
SCENE_G
lobal
);
return
StringHelper
.
getFirst
(
this
.
threadScene
.
get
(),
SCENE_G
LOBAL
);
}
...
...
@@ -195,7 +195,7 @@ public class YzgLanguage {
// 获取语言对应关系
Map
<
String
,
String
>
defaultFrom
=
getDefaultFrom
(
sceneName
,
defaultLanguageValue
);
// 设置默认语言
defaultFrom
.
put
(
defaulLanguage
,
defaultLanguageValue
);
defaultFrom
.
put
(
defaul
t
Language
,
defaultLanguageValue
);
// 设置语言
defaultFrom
.
put
(
language
,
languageValue
);
...
...
@@ -231,7 +231,7 @@ public class YzgLanguage {
return
ret
;
}
// 获取语言对应关系
Map
<
String
,
String
>
globalFrom
=
getDefaultFrom
(
SCENE_G
lobal
,
defaultLanguageValue
);
Map
<
String
,
String
>
globalFrom
=
getDefaultFrom
(
SCENE_G
LOBAL
,
defaultLanguageValue
);
// 获取对应语言
ret
=
globalFrom
.
get
(
language
);
if
(!
StringHelper
.
isEmpty
(
ret
))
{
...
...
yzg-util-base/src/test/java/helper/CheckHelperTest.java
View file @
b12b31c3
...
...
@@ -26,10 +26,10 @@ public class CheckHelperTest {
@Test
public
void
testCh
()
{
// 设置默认语言为中文
language
.
setDefaulLanguage
(
YzgLanguage
.
LANGUAGE_CH
);
language
.
setDefaul
t
Language
(
YzgLanguage
.
LANGUAGE_CH
);
testEn
();
// 设置默认语言为英文
language
.
setDefaulLanguage
(
YzgLanguage
.
LANGUAGE_EN
);
language
.
setDefaul
t
Language
(
YzgLanguage
.
LANGUAGE_EN
);
}
@Test
...
...
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