diff --git a/Translations/TranslationEditor.html b/Translations/TranslationEditor.html index ecb85365..6f0ee320 100644 --- a/Translations/TranslationEditor.html +++ b/Translations/TranslationEditor.html @@ -193,41 +193,59 @@ return str; }, - validateWholeScreenMessage: function(valMap, id) { - var d = defMap[id]; - if (this.isSmall(valMap[id])) { - if (valMap[id][0].length === 0) { + getWholeScreenMessageMaxLen: function(valMap, id, prop) { + var v = prop ? valMap[id][prop] : valMap[id]; + var maxLen; + if (this.isSmall(v)) { + maxLen = defMap[id].maxLen2 || 16; + } else { + maxLen = defMap[id].maxLen || 8; + } + return maxLen; + }, + + validateWholeScreenMessage: function(valMap, id, prop) { + var v = prop ? valMap[id][prop] : valMap[id]; + var maxLen = this.getWholeScreenMessageMaxLen(valMap, id, prop); + if (this.isSmall(v)) { + if (v[0].length === 0) { return "invalid"; - } else if (Math.max(valMap[id][0].length, valMap[id][1].length) > 16) { + } else if (Math.max(v[0].length, v[1].length) > maxLen) { return "invalid"; } } else { - if (valMap[id].length > 8) { + if (v.length > maxLen) { return "invalid"; } } }, - constraintWholeScreenMessage: function(v) { - if (this.isSmall(v)) { - return "len <= 16"; - } else { - return "len <= 8"; - } + constraintWholeScreenMessage: function(valMap, id, prop) { + return "len <= " + this.getWholeScreenMessageMaxLen(valMap, id, prop); }, isSmall: function(v) { return v instanceof Array; }, - convertToLarge: function(valMap, id) { - var message = valMap[id][0] + (valMap[id][1] !== "" ? " " + valMap[id][1] : ""); - valMap[id] = message; + convertToLarge: function(valMap, id, prop) { + var v = prop ? valMap[id][prop] : valMap[id]; + var message = v[0] + (v[1] !== "" ? " " + v[1] : ""); + if (prop) { + valMap[id][prop] = message; + } else { + valMap[id] = message; + } }, - convertToSmall: function(valMap, id) { - var message = valMap[id] - valMap[id] = [ message, "" ]; + convertToSmall: function(valMap, id, prop) { + var v = prop ? valMap[id][prop] : valMap[id]; + var message = [ v, "" ]; + if (prop) { + valMap[id][prop] = message; + } else { + valMap[id] = message; + } } } }); @@ -316,7 +334,7 @@
{{menu.id}} |
Menu Name
- {{constraintString(menu)}}
+ {{constraintWholeScreenMessage(current.menuGroups, menu.id, 'text2')}}
{{referent.menuGroups[menu.id].text2}}
-
+
+
+
+
+
+
+
+
+
Description
{{referent.menuGroups[menu.id].desc}}
@@ -362,14 +388,22 @@
Menu Options
|