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
Mikolaï Krol
erp5
Commits
8b4be062
Commit
8b4be062
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
0573083e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
202 additions
and
175 deletions
+202
-175
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
+34
-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
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
8b4be062
...
@@ -549,6 +549,9 @@
...
@@ -549,6 +549,9 @@
return
route
(
this
,
'
translation_gadget
'
,
'
getTranslationList
'
,
return
route
(
this
,
'
translation_gadget
'
,
'
getTranslationList
'
,
argument_list
);
argument_list
);
})
})
.
allowPublicAcquisition
(
"
getSelectedLanguage
"
,
function
getSelectedLanguage
()
{
return
route
(
this
,
'
translation_gadget
'
,
'
getSelectedLanguage
'
);
})
.
allowPublicAcquisition
(
"
redirect
"
,
function
redirect
(
param_list
)
{
.
allowPublicAcquisition
(
"
redirect
"
,
function
redirect
(
param_list
)
{
return
route
(
this
,
'
router
'
,
'
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 @
8b4be062
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15777
03410.9
3
</float>
<float>
15777
60448.3
3
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_js.js
View file @
8b4be062
/*global document, window, rJS, translation_data */
/*global document, window,
RSVP,
rJS, translation_data */
/*jslint nomen: true, indent: 2 */
/*jslint nomen: true, indent: 2 */
(
function
(
document
,
window
,
rJS
,
translation_data
)
{
(
function
(
document
,
window
,
RSVP
,
rJS
,
translation_data
)
{
"
use strict
"
;
"
use strict
"
;
function
getSelectedLanguage
(
gadget
)
{
var
queue
=
new
RSVP
.
Queue
();
if
(
!
gadget
.
state
.
language
)
{
queue
.
push
(
function
()
{
return
gadget
.
getSettingList
([
"
selected_language
"
,
"
default_selected_language
"
]);
})
.
push
(
function
(
result_list
)
{
gadget
.
state
.
language
=
result_list
[
0
]
||
result_list
[
1
];
});
}
return
queue
.
push
(
function
()
{
return
gadget
.
state
.
language
;
});
}
function
translate
(
string
,
gadget
)
{
function
translate
(
string
,
gadget
)
{
if
(
translation_data
[
gadget
.
state
.
language
])
{
if
(
translation_data
[
gadget
.
state
.
language
])
{
return
translation_data
[
gadget
.
state
.
language
][
string
]
||
string
;
return
translation_data
[
gadget
.
state
.
language
][
string
]
||
string
;
...
@@ -106,20 +126,17 @@
...
@@ -106,20 +126,17 @@
}
}
function
promiseTranslateList
(
gadget
,
string_list
,
only_first
)
{
function
promiseTranslateList
(
gadget
,
string_list
,
only_first
)
{
// XXX Allow to change the language
return
getSelectedLanguage
(
gadget
)
if
(
!
gadget
.
state
.
language
)
{
.
push
(
function
()
{
return
gadget
.
getSettingList
([
"
selected_language
"
,
return
translateList
(
gadget
,
string_list
,
only_first
);
"
default_selected_language
"
])
});
.
push
(
function
(
result_list
)
{
gadget
.
state
.
language
=
result_list
[
0
]
||
result_list
[
1
];
return
translateList
(
gadget
,
string_list
,
only_first
);
});
}
return
translateList
(
gadget
,
string_list
,
only_first
);
}
}
rJS
(
window
)
rJS
(
window
)
.
declareAcquiredMethod
(
"
getSettingList
"
,
"
getSettingList
"
)
.
declareAcquiredMethod
(
"
getSettingList
"
,
"
getSettingList
"
)
.
declareMethod
(
'
getSelectedLanguage
'
,
function
()
{
return
getSelectedLanguage
(
this
);
})
.
declareMethod
(
'
getTranslationList
'
,
function
(
string_list
)
{
.
declareMethod
(
'
getTranslationList
'
,
function
(
string_list
)
{
return
promiseTranslateList
(
this
,
string_list
);
return
promiseTranslateList
(
this
,
string_list
);
})
})
...
@@ -129,15 +146,10 @@
...
@@ -129,15 +146,10 @@
.
declareMethod
(
'
translateHtml
'
,
function
(
string
)
{
.
declareMethod
(
'
translateHtml
'
,
function
(
string
)
{
var
gadget
=
this
;
var
gadget
=
this
;
if
(
!
gadget
.
state
.
language
)
{
return
getSelectedLanguage
(
gadget
)
return
gadget
.
getSettingList
([
"
selected_language
"
,
.
push
(
function
(
language
)
{
"
default_selected_language
"
])
return
translateHtml
(
string
,
gadget
);
.
push
(
function
(
result_list
)
{
});
gadget
.
state
.
language
=
result_list
[
0
]
||
result_list
[
1
];
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 @
8b4be062
...
@@ -152,171 +152,183 @@
...
@@ -152,171 +152,183 @@
</record>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
publish_alive
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
publish_alive
</string>
</value>
<key>
<string>
actor
</string>
</key>
</item>
<value>
<string>
cedric.le.ninivin
</string>
</value>
<item>
</item>
<key>
<string>
actor
</string>
</key>
<item>
<value>
<string>
cedric.le.ninivin
</string>
</value>
<key>
<string>
comment
</string>
</key>
</item>
<value>
<string></string>
</value>
<item>
</item>
<key>
<string>
comment
</string>
</key>
<item>
<value>
<string></string>
</value>
<key>
<string>
error_message
</string>
</key>
</item>
<value>
<string></string>
</value>
<item>
</item>
<key>
<string>
error_message
</string>
</key>
<item>
<value>
<string></string>
</value>
<key>
<string>
time
</string>
</key>
</item>
<value>
<item>
<object>
<key>
<string>
time
</string>
</key>
<klass>
<value>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<object>
</klass>
<klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<none/>
</klass>
</tuple>
<tuple>
<state>
<none/>
<tuple>
</tuple>
<float>
1438012141.03
</float>
<state>
<string>
UTC
</string>
<tuple>
</tuple>
<float>
1438012141.03
</float>
</state>
<string>
UTC
</string>
</object>
</tuple>
</value>
</state>
</item>
</object>
<item>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
published_alive
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
published_alive
</string>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
edit
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
edit
</string>
</value>
<key>
<string>
actor
</string>
</key>
</item>
<value>
<string>
zope
</string>
</value>
<item>
</item>
<key>
<string>
actor
</string>
</key>
<item>
<value>
<string>
zope
</string>
</value>
<key>
<string>
comment
</string>
</key>
</item>
<value>
<item>
<none/>
<key>
<string>
comment
</string>
</key>
</value>
<value>
</item>
<none/>
<item>
</value>
<key>
<string>
error_message
</string>
</key>
</item>
<value>
<string></string>
</value>
<item>
</item>
<key>
<string>
error_message
</string>
</key>
<item>
<value>
<string></string>
</value>
<key>
<string>
serial
</string>
</key>
</item>
<value>
<string>
968.42890.13273.63180
</string>
</value>
<item>
</item>
<key>
<string>
serial
</string>
</key>
<item>
<value>
<string>
980.48186.1859.61969
</string>
</value>
<key>
<string>
state
</string>
</key>
</item>
<value>
<string>
current
</string>
</value>
<item>
</item>
<key>
<string>
state
</string>
</key>
<item>
<value>
<string>
current
</string>
</value>
<key>
<string>
time
</string>
</key>
</item>
<value>
<item>
<object>
<key>
<string>
time
</string>
</key>
<klass>
<value>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<object>
</klass>
<klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<none/>
</klass>
</tuple>
<tuple>
<state>
<none/>
<tuple>
</tuple>
<float>
1530622707.63
</float>
<state>
<string>
UTC
</string>
<tuple>
</tuple>
<float>
1577760469.24
</float>
</state>
<string>
UTC
</string>
</object>
</tuple>
</value>
</state>
</item>
</object>
</dictionary>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
detect_converted_file
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
detect_converted_file
</string>
</value>
<key>
<string>
actor
</string>
</key>
</item>
<value>
<string>
cedric.le.ninivin
</string>
</value>
<item>
</item>
<key>
<string>
actor
</string>
</key>
<item>
<value>
<string>
cedric.le.ninivin
</string>
</value>
<key>
<string>
comment
</string>
</key>
</item>
<value>
<string></string>
</value>
<item>
</item>
<key>
<string>
comment
</string>
</key>
<item>
<value>
<string></string>
</value>
<key>
<string>
error_message
</string>
</key>
</item>
<value>
<string></string>
</value>
<item>
</item>
<key>
<string>
error_message
</string>
</key>
<item>
<value>
<string></string>
</value>
<key>
<string>
external_processing_state
</string>
</key>
</item>
<value>
<string>
converted
</string>
</value>
<item>
</item>
<key>
<string>
external_processing_state
</string>
</key>
<item>
<value>
<string>
converted
</string>
</value>
<key>
<string>
serial
</string>
</key>
</item>
<value>
<string>
0.0.0.0
</string>
</value>
<item>
</item>
<key>
<string>
serial
</string>
</key>
<item>
<value>
<string>
0.0.0.0
</string>
</value>
<key>
<string>
time
</string>
</key>
</item>
<value>
<item>
<object>
<key>
<string>
time
</string>
</key>
<klass>
<value>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<object>
</klass>
<klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<none/>
</klass>
</tuple>
<tuple>
<state>
<none/>
<tuple>
</tuple>
<float>
1438012010.81
</float>
<state>
<string>
UTC
</string>
<tuple>
</tuple>
<float>
1438012010.81
</float>
</state>
<string>
UTC
</string>
</object>
</tuple>
</value>
</state>
</item>
</object>
</dictionary>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</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