Sourcecode in Global/objectFunctions.js:
1: function getMessage(property, value) {
2: var languages = getLanguages();
3: // loop over languages and try to find the message
4: var lang;
5: var source;
6: for (var i=0;i<languages.length;i++) {
7: if (!(lang = app.data[languages[i]]))
8: continue;
9: if (!(source = lang.getProperty(property)))
10: continue;
11: var param = new Object();
12: // check if value passed is a string or an array
13: if (value) {
14: if (value instanceof Array) {
15: for (var j=0;j<value.length;j++)
16: param["value" + (j+1)] = value[j];
17: } else if (typeof value == "object") {
18: param = value;
19: } else {
20: param.value1 = value;
21: }
22: }
23: return renderSkinAsString(createSkin(source), param);
24: }
25: // still no message found, so return
26: return "[couldn't find message!]";
27: }
|