Commit 483d75e0 authored by yanzg's avatar yanzg

视频压缩

parent 28f668d3
......@@ -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 {
* @return
*/
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 {
return ret;
}
// 获取语言对应关系
Map<String, String> globalFrom = getDefaultFrom(SCENE_DEFAULT, defaultLanguageValue);
Map<String, String> globalFrom = getDefaultFrom(SCENE_Global, defaultLanguageValue);
// 获取对应语言
ret = globalFrom.get(language);
if (!StringHelper.isEmpty(ret)) {
......
......@@ -5,8 +5,14 @@ import com.yanzuoguang.util.helper.YzgLanguage;
import org.junit.Test;
public class CheckHelperTest {
// 设置默认语言为中文
static YzgLanguage language = YzgLanguage.get();
static String scene_user = "用户检测";
static {
language.setEnglishChinese("name", "名称");
language.setEnglishChinese(scene_user, "name", "姓名");
CheckerHelper.newInstance();
}
......@@ -20,30 +26,23 @@ public class CheckHelperTest {
@Test
public void testCh() {
// 设置默认语言为中文
YzgLanguage language = YzgLanguage.get();
language.setDefaulLanguage(YzgLanguage.LANGUAGE_CH);
language.setEnglishChinese("name", "名称");
testEn();
// 设置默认语言为英文
language.setDefaulLanguage(YzgLanguage.LANGUAGE_EN);
}
@Test
public void testChScene() {
// 设置默认语言为中文
YzgLanguage language = YzgLanguage.get();
language.setDefaulLanguage(YzgLanguage.LANGUAGE_CH);
language.setEnglishChinese("name", "名称");
String scene1 = "用户检测";
language.setEnglishChinese(scene1, "name", "姓名");
// 设置当前线程语言为中文
language.setThreadLanguage(YzgLanguage.LANGUAGE_CH);
language.setThreadScene(scene_user);
language.setThreadScene(scene1);
testEn();
// 设置默认语言为英文
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