Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Klaus Wölfel
erp5
Commits
74f37187
Commit
74f37187
authored
Dec 23, 2019
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: let gadget know the language in which the interface is rendered
parent
07fd9edc
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
366 additions
and
326 deletions
+366
-326
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
...mplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
+3
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
...plateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_js.js
...TemplateItem/web_page_module/rjs_gadget_translation_js.js
+28
-22
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_js.xml
...emplateItem/web_page_module/rjs_gadget_translation_js.xml
+163
-151
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_interface_translation.html
...mplateItem/web_page_module/rjs_interface_translation.html
+7
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_interface_translation.xml
...emplateItem/web_page_module/rjs_interface_translation.xml
+163
-151
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
74f37187
...
...
@@ -549,6 +549,9 @@
return
route
(
this
,
'
translation_gadget
'
,
'
getTranslationList
'
,
argument_list
);
})
.
allowPublicAcquisition
(
"
getSelectedLanguage
"
,
function
getSelectedLanguage
()
{
return
route
(
this
,
'
translation_gadget
'
,
'
getSelectedLanguage
'
);
})
.
allowPublicAcquisition
(
"
redirect
"
,
function
redirect
(
param_list
)
{
return
route
(
this
,
'
router
'
,
'
redirect
'
,
param_list
);
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
74f37187
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
78.22304.53878.1495
</string>
</value>
<value>
<string>
9
80.43952.30132.41164
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
15777
03410.9
3
</float>
<float>
15777
60448.3
3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_js.js
View file @
74f37187
/*global document, window, rJS, translation_data */
/*global document, window,
RSVP,
rJS, translation_data */
/*jslint nomen: true, indent: 2 */
(
function
(
document
,
window
,
rJS
,
translation_data
)
{
(
function
(
document
,
window
,
RSVP
,
rJS
,
translation_data
)
{
"
use strict
"
;
function
getSelectedLanguage
(
gadget
,
callback
)
{
if
(
!
gadget
.
state
.
language
)
{
return
gadget
.
getSettingList
([
"
selected_language
"
,
"
default_selected_language
"
])
.
push
(
function
(
result_list
)
{
gadget
.
state
.
language
=
result_list
[
0
]
||
result_list
[
1
];
return
callback
(
gadget
.
state
.
language
);
});
}
return
callback
(
gadget
.
state
.
language
);
}
function
translate
(
string
,
gadget
)
{
if
(
translation_data
[
gadget
.
state
.
language
])
{
return
translation_data
[
gadget
.
state
.
language
][
string
]
||
string
;
...
...
@@ -106,20 +120,18 @@
}
function
promiseTranslateList
(
gadget
,
string_list
,
only_first
)
{
// XXX Allow to change the language
if
(
!
gadget
.
state
.
language
)
{
return
gadget
.
getSettingList
([
"
selected_language
"
,
"
default_selected_language
"
])
.
push
(
function
(
result_list
)
{
gadget
.
state
.
language
=
result_list
[
0
]
||
result_list
[
1
];
return
getSelectedLanguage
(
gadget
,
function
()
{
return
translateList
(
gadget
,
string_list
,
only_first
);
});
}
return
translateList
(
gadget
,
string_list
,
only_first
);
}
rJS
(
window
)
.
declareAcquiredMethod
(
"
getSettingList
"
,
"
getSettingList
"
)
.
declareMethod
(
'
getSelectedLanguage
'
,
function
()
{
return
getSelectedLanguage
(
this
,
function
(
language
)
{
return
language
;
});
})
.
declareMethod
(
'
getTranslationList
'
,
function
(
string_list
)
{
return
promiseTranslateList
(
this
,
string_list
);
})
...
...
@@ -129,15 +141,9 @@
.
declareMethod
(
'
translateHtml
'
,
function
(
string
)
{
var
gadget
=
this
;
if
(
!
gadget
.
state
.
language
)
{
return
gadget
.
getSettingList
([
"
selected_language
"
,
"
default_selected_language
"
])
.
push
(
function
(
result_list
)
{
gadget
.
state
.
language
=
result_list
[
0
]
||
result_list
[
1
];
return
getSelectedLanguage
(
gadget
,
function
()
{
return
translateHtml
(
string
,
gadget
);
});
}
return
translateHtml
(
string
,
gadget
);
});
}(
document
,
window
,
rJS
,
translation_data
));
}(
document
,
window
,
RSVP
,
rJS
,
translation_data
));
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_js.xml
View file @
74f37187
...
...
@@ -152,11 +152,13 @@
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -200,16 +202,20 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -232,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
968.42890.13273.63180
</string>
</value>
<value>
<string>
981.1053.43706.60842
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -250,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>
1530622707.63
</float>
<float>
1578453690.65
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
@@ -259,16 +265,20 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -316,7 +326,9 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_interface_translation.html
View file @
74f37187
...
...
@@ -8,6 +8,13 @@
<h3>
Gadget used to translate text
</h3>
<dl>
<dt>
getSelectedLanguage
</dt>
<dd>
Return the selected language, in which the UI is displayed
</dd>
<dl>
<dt></dt>
<dd></dd>
</dl>
<dt>
translate
</dt>
<dd>
Translate a text
</dd>
<dl>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_interface_translation.xml
View file @
74f37187
...
...
@@ -152,11 +152,13 @@
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -200,16 +202,20 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -232,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
969.42104.25183.61832
</string>
</value>
<value>
<string>
980.55319.6399.26880
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -250,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>
1534507750.94
</float>
<float>
1578361034.9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
@@ -259,16 +265,20 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
...
...
@@ -316,7 +326,9 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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