Commit 483d75e0 authored by yanzg's avatar yanzg

视频压缩

parent 28f668d3
...@@ -23,7 +23,7 @@ public class YzgLanguage { ...@@ -23,7 +23,7 @@ public class YzgLanguage {
/** /**
* 默认场景 * 默认场景
*/ */
public static final String SCENE_DEFAULT = "DEFAULT"; public static final String SCENE_Global = "GLOBAL";
/** /**
* 英语 * 英语
...@@ -128,7 +128,7 @@ public class YzgLanguage { ...@@ -128,7 +128,7 @@ public class YzgLanguage {
* @return * @return
*/ */
public String getScene() { public String getScene() {
return StringHelper.getFirst(this.threadScene.get(), SCENE_DEFAULT); return StringHelper.getFirst(this.threadScene.get(), SCENE_Global);
} }
...@@ -218,7 +218,7 @@ public class YzgLanguage { ...@@ -218,7 +218,7 @@ public class YzgLanguage {
return ret; return ret;
} }
// 获取语言对应关系 // 获取语言对应关系
Map<String, String> globalFrom = getDefaultFrom(SCENE_DEFAULT, defaultLanguageValue); Map<String, String> globalFrom = getDefaultFrom(SCENE_Global, defaultLanguageValue);
// 获取对应语言 // 获取对应语言
ret = globalFrom.get(language); ret = globalFrom.get(language);
if (!StringHelper.isEmpty(ret)) { if (!StringHelper.isEmpty(ret)) {
......
...@@ -5,8 +5,14 @@ import com.yanzuoguang.util.helper.YzgLanguage; ...@@ -5,8 +5,14 @@ import com.yanzuoguang.util.helper.YzgLanguage;
import org.junit.Test; import org.junit.Test;
public class CheckHelperTest { public class CheckHelperTest {
// 设置默认语言为中文
static YzgLanguage language = YzgLanguage.get();
static String scene_user = "用户检测";
static { static {
language.setEnglishChinese("name", "名称");
language.setEnglishChinese(scene_user, "name", "姓名");
CheckerHelper.newInstance(); CheckerHelper.newInstance();
} }
...@@ -20,30 +26,23 @@ public class CheckHelperTest { ...@@ -20,30 +26,23 @@ public class CheckHelperTest {
@Test @Test
public void testCh() { public void testCh() {
// 设置默认语言为中文 // 设置默认语言为中文
YzgLanguage language = YzgLanguage.get();
language.setDefaulLanguage(YzgLanguage.LANGUAGE_CH); language.setDefaulLanguage(YzgLanguage.LANGUAGE_CH);
language.setEnglishChinese("name", "名称");
testEn(); testEn();
// 设置默认语言为英文 // 设置默认语言为英文
language.setDefaulLanguage(YzgLanguage.LANGUAGE_EN); language.setDefaulLanguage(YzgLanguage.LANGUAGE_EN);
} }
@Test @Test
public void testChScene() { public void testChScene() {
// 设置默认语言为中文 // 设置当前线程语言为中文
YzgLanguage language = YzgLanguage.get(); language.setThreadLanguage(YzgLanguage.LANGUAGE_CH);
language.setDefaulLanguage(YzgLanguage.LANGUAGE_CH); language.setThreadScene(scene_user);
language.setEnglishChinese("name", "名称");
String scene1 = "用户检测";
language.setEnglishChinese(scene1, "name", "姓名");
language.setThreadScene(scene1);
testEn(); testEn();
// 设置默认语言为英文 // 设置默认语言为英文
language.setDefaulLanguage(YzgLanguage.LANGUAGE_EN); language.setDefaulLanguage(YzgLanguage.LANGUAGE_EN);
language.removeThreadScene();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment