This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
/* Xeslint-disable */
|
/* Xeslint-disable */
|
||||||
import store from "../store";
|
import store from "../store";
|
||||||
|
import locale from "./locale";
|
||||||
|
|
||||||
var devModeShowErrors = false;
|
var devModeShowErrors = false;
|
||||||
|
|
||||||
|
//TODO: tie this into form error display somehow so that form can control whether to show particular error or not
|
||||||
|
//i.e. dealwitherror(msg,formerrordisplayfunction,bool shouldshowError)
|
||||||
function dealWithError(msg) {
|
function dealWithError(msg) {
|
||||||
|
msg = locale.translateString(msg);
|
||||||
store.commit("logItem", msg);
|
store.commit("logItem", msg);
|
||||||
if (devModeShowErrors) {
|
if (devModeShowErrors) {
|
||||||
alert("Error: " + msg);
|
alert("Error: " + msg);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import store from "../store";
|
|||||||
import router from "../router";
|
import router from "../router";
|
||||||
import auth from "./auth";
|
import auth from "./auth";
|
||||||
import errorHandler from "./errorhandler";
|
import errorHandler from "./errorhandler";
|
||||||
import locale from "./locale";
|
|
||||||
|
|
||||||
function stringifyPrimitive(v) {
|
function stringifyPrimitive(v) {
|
||||||
switch (typeof v) {
|
switch (typeof v) {
|
||||||
|
|||||||
@@ -114,5 +114,19 @@ export default {
|
|||||||
shortDateAndTime: "YYYY-MM-DD hh:mm:ss A"
|
shortDateAndTime: "YYYY-MM-DD hh:mm:ss A"
|
||||||
},
|
},
|
||||||
//timeZoneOffset is in decimal hours
|
//timeZoneOffset is in decimal hours
|
||||||
timeZoneOffset: -8.0
|
timeZoneOffset: -8.0,
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
// Take in a string that contains one or more
|
||||||
|
//locale keys between square brackets
|
||||||
|
//translate each and return the string translated
|
||||||
|
//
|
||||||
|
translateString(s) {
|
||||||
|
var ret = s;
|
||||||
|
var pattern = /\[(.*?)\]/g;
|
||||||
|
var match;
|
||||||
|
while ((match = pattern.exec(s)) != null) {
|
||||||
|
ret.replace(match, this.get(match));
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user