Commit 75e12ad8 authored by Sven Franck's avatar Sven Franck

app: fixed translation of input/select JQM inserted <span> tags

parent 0f0f46ca
......@@ -442,7 +442,8 @@
// add <span> which contains JQM current select
if (element_reverse) {
element_target.appendChild(factory.element({"type": "span"}));
element_target.appendChild(factory.element({
"type": "span"}));
} else {
element_target = container;
}
......@@ -2979,14 +2980,14 @@
* @param {object} nodeList Nodelist to translate
* @param {boolean} single Single element
**/
// TODO: no solution yet for selectMenu-refesh and input (submit/reset/btn)
// TODO: don't call this so often on init
"translateNodeList": function (nodeList, single) {
var i, l, element, lookup, targets, target, route_text, elements;
var i, l, element, lookup, targets, target, route_text, elements, len;
elements = single ? [nodeList] : nodeList.querySelectorAll(".translate");
if (i18n) {
for (i = 0; i < elements.length; i += 1) {
for (i = 0, len = elements.length; i < len; i += 1) {
element = elements[i];
lookup = element.getAttribute("data-i18n");
......@@ -3040,6 +3041,13 @@
}
}
}
// handle select > span!
if (element.tagName === "OPTION") {
if (element.selected) {
element.parentNode.previousSibling.textContent =
element.textContent;
}
}
}
} else {
app.util.error("Translate NodeList - i18n not defined");
......@@ -3056,11 +3064,6 @@
// TODO: figure out a way to translate per gadget!
// TODO: figure out if and how to translate meta easily
"translate": function (obj, language, init) {
console.log("SO???")
console.log(obj)
console.log(language)
console.log(init)
var class_list,
lookup,
new_language,
......
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