Commit 86420a20 zshaohui

1.增加默认语言显示功能

1 个父辈 c09349eb
...@@ -434,9 +434,9 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -434,9 +434,9 @@ public class BaseDeviceHandler implements IDeviceHandler {
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
log.info("出库已在库位中的物料[" + barcodeSave.getBarcode() + "]"); log.info("出库已在库位中的物料[" + barcodeSave.getBarcode() + "]");
String msg=MessageUtils.getText("smfcore.error.barcode.inStorage",new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()},MessageUtils.getDefaultLocal(), String msg=MessageUtils.getText("smfcore.error.barcode.inStorage",new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()},MessageUtils.getDefaultLocal(),
"[ " + barcodeSave.getBarcode() + "]已在" + storage.getName() + "[" + pos.getPosName() + "]中"); "[{0}]已在{1}[{2}]中");
taskService.checkout(storage, pos, true, true, "", "", msg); taskService.checkout(storage, pos, true, true, "", "", msg);
throw new ValidateException("smfcore.error.barcode.inStorage", "[ " + barcodeSave.getBarcode() + "]已在" + storage.getName() + "[" + pos.getPosName() + "]中", new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()}); throw new ValidateException("smfcore.error.barcode.inStorage", "[{0}]已在{1}[{2}]中", new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()});
} }
for (DataLog task : taskService.getQueueTasks()) { for (DataLog task : taskService.getQueueTasks()) {
......
...@@ -350,7 +350,7 @@ public class DeviceController { ...@@ -350,7 +350,7 @@ public class DeviceController {
} }
} catch (ValidateException ve) { } catch (ValidateException ve) {
errorMsg = ve.getMessage(); errorMsg = ve.getMessage();
errorMsg= MessageUtils.getText(ve.getMsgKey(),ve.getMsgParam(),new Locale("en","US"),ve.getDefaultMsg()); errorMsg= MessageUtils.getText(ve.getMsgKey(),ve.getMsgParam(),MessageUtils.getDefaultLocal(),ve.getDefaultMsg());
log.info("查找空库位失败:" + errorMsg); log.info("查找空库位失败:" + errorMsg);
resultMap.put("result", "105"); resultMap.put("result", "105");
resultMap.put("msg",errorMsg); resultMap.put("msg",errorMsg);
......
...@@ -124,7 +124,12 @@ public class MessageUtils { ...@@ -124,7 +124,12 @@ public class MessageUtils {
//-----------------以下为从缓存读取资源------------------------------------- //-----------------以下为从缓存读取资源-------------------------------------
public static Locale getDefaultLocal(){ public static Locale getDefaultLocal(){
if(ObjectUtil.isNotEmpty(defLanguage)){ if(ObjectUtil.isNotEmpty(defLanguage)){
return new Locale(defLanguage); if ("en".equals(defLanguage)){
return new Locale("en","US");
} else if ("zh".equals(defLanguage)){
return new Locale("zh-CH");
}
//return new Locale(defLanguage);
} }
return new Locale("zh-CH"); return new Locale("zh-CH");
} }
......
...@@ -44,6 +44,7 @@ rsa: ...@@ -44,6 +44,7 @@ rsa:
app: app:
version: '@app.version@' version: '@app.version@'
defLanguage: zh #en是英语,zh是中文
type: "" type: ""
menu: menu:
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!