Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
949965f6
Commit
949965f6
authored
Jan 05, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Do not lose child element when translating HTML text content
parent
cef8cfcb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_js.xml
...emplateItem/web_page_module/rjs_gadget_translation_js.xml
+13
-10
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_js.xml
View file @
949965f6
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
// translate a list of elements passed and returned as string\n
// translate a list of elements passed and returned as string\n
.declareMethod(\'translateHtml\', function (my_string) {\n
.declareMethod(\'translateHtml\', function (my_string) {\n
var temp, element_list, i, i_len, element, lookup, translate_list, target,\n
var temp, element_list, i, i_len, element, lookup, translate_list, target,\n
route_text, has_breaks, l, l_len, gadget;\n
route_text, has_breaks, l, l_len, gadget
, j, j_len
;\n
\n
\n
gadget = this;\n
gadget = this;\n
\n
\n
...
@@ -200,12 +200,15 @@
...
@@ -200,12 +200,15 @@
element.innerHTML = translate(target[1]);\n
element.innerHTML = translate(target[1]);\n
break;\n
break;\n
default:\n
default:\n
// NOTE: be careful of emptying elements with children!\n
if (element.hasChildNodes()) {\n
while (element.hasChildNodes()) {\n
for (j = 0, j_len = element.childNodes.length; j
< j_len
;
j
+=
1)
{\n
element.removeChild(element.lastChild);\n
if
(element.childNodes[j]
.nodeType =
==
3)
{\n
element.childNodes[j]
.textContent =
translate(translate_list[l]);\n
}\n
}\n
}
else
{\n
element.textContent =
translate(translate_list[l]);\n
}\n
}\n
element.appendChild(document.createTextNode(translate(translate_list[l])));\n
element.appendChild(document.createElement("span"));\n
break;\n
break;\n
}\n
}\n
}\n
}\n
...
@@ -341,7 +344,7 @@
...
@@ -341,7 +344,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -355,7 +358,7 @@
...
@@ -355,7 +358,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.45862.6528.13858
</string>
</value>
<value>
<string>
94
8.17388.42239.34542
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -373,8 +376,8 @@
...
@@ -373,8 +376,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
45935096.31
</float>
<float>
14
52009218.06
</float>
<string>
GMT
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment