Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cloud-quote
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
cloud-quote
Commits
67e6b418
Commit
67e6b418
authored
Apr 23, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed translations of popups (outside gadget.dom)
parent
bf7d037e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
gadgets/translate.html
gadgets/translate.html
+23
-12
No files found.
gadgets/translate.html
View file @
67e6b418
...
...
@@ -65,10 +65,10 @@
</head>
<body>
<span
class=
"ui-hidden-accessible el"
>
</span>
<a
data-role=
"button"
class=
"setIcon"
href=
""
data-rel=
"popup"
data-position-to=
"origin"
data-icon=
"lang"
data-iconpos=
"notext"
>
Languages
</a>
<a
data-role=
"button"
class=
"setIcon
popup_trigger
"
href=
""
data-rel=
"popup"
data-position-to=
"origin"
data-icon=
"lang"
data-iconpos=
"notext"
>
Languages
</a>
<div
data-role=
"popup"
class=
"all_popups"
>
<ul
data-role=
"listview"
data-inset=
"true"
data-divider-theme=
"f"
>
<li
data-role=
"list-divider"
class=
"t"
data-i18n=
"gen.language"
></li>
<li
data-role=
"list-divider"
class=
"t"
data-i18n=
"gen.language"
>
Languages
</li>
<li
data-icon=
"false"
><a
class=
"t change_language"
href=
"?lang=fr-FR"
data-i18n-target=
".ui-li-text"
data-i18n=
"[title]gen.language_info;[html]gen.lang.fr"
><span
class=
"ui-icon ui-fake-icon ui-li-icon ui-icon-lang ui-li-thumb FR"
>
</span><span
class=
"ui-li-text"
></span></a></li>
<li
data-icon=
"false"
><a
class=
"t change_language"
href=
"?lang=de-DE"
data-i18n-target=
".ui-li-text"
data-i18n=
"[title]gen.language_info;[html]gen.lang.de"
><span
class=
"ui-icon ui-fake-icon ui-li-icon ui-icon-lang ui-li-thumb DE"
>
</span><span
class=
"ui-li-text"
></span></a></li>
<li
data-icon=
"false"
><a
class=
"t change_language"
href=
"?lang=en-EN"
data-i18n-target=
".ui-li-text"
data-i18n=
"[title]gen.language_info;[html]gen.lang.en"
><span
class=
"ui-icon ui-fake-icon ui-li-icon ui-icon-lang ui-li-thumb EN"
>
</span><span
class=
"ui-li-text"
></span></a></li>
...
...
@@ -100,7 +100,7 @@
},
// set language
set_lang
=
function
(
language
)
{
var
set_icon
,
elem
,
override
=
false
,
remote
;
var
set_icon
,
elem
,
override
=
false
,
remote
,
popups
,
i
,
link
;
switch
(
language
)
{
case
"
de-DE
"
:
...
...
@@ -117,10 +117,6 @@
// trigger create
if
(
gadget
.
isEnhanced
()
===
false
)
{
$
(
document
).
trigger
(
"
render_enhance
"
,
{
"
gadget
"
:
gadget
.
dom
});
// no other way to translate popups, because the popup will be moved to the end of the DOM
remote
=
gadget
.
dom
.
find
(
"
a
"
).
attr
(
'
href
'
);
// doing it differently breaks wrapping elements (collapsibles)
$
(
'
.ui-popup-container span.t, .ui-popup-container a.t
'
).
i18n
();
}
if
(
$
.
fn
.
fauna
.
i18n_current_lang
!==
language
)
{
...
...
@@ -129,16 +125,31 @@
// translate all gadgets in the gadget list (dom available)
for
(
i
=
0
;
i
<
list
.
length
;
i
+=
1
)
{
gadget_to_translate
=
list
[
i
];
if
(
gadget_to_translate
.
isEnhanced
()
===
false
||
override
)
{
console
.
log
(
"
found gadget, id=
"
+
gadget_to_translate
.
id
);
gadget_to_translate
.
dom
.
find
(
"
.t
"
)
.
i18n
()
.
end
()
.
i18n
()
.
end
()
// in JQM, we also need to update all widgets with "artificial"
// text elements, such as selects
// not nice: there must be a better way to do this!
.
find
(
"
select
"
).
selectmenu
(
"
refresh
"
).
end
();
.
find
(
"
select
"
)
.
selectmenu
(
"
refresh
"
)
.
end
()
.
find
(
"
a.popup_trigger
"
)
// exclude recursive gadgets
.
filter
(
function
(){
return
!
gadget_to_translate
.
dom
.
find
(
"
[data-gadget]
"
).
find
(
this
).
length
;
}
)
.
each
(
function
(
index
,
element
){
remote
=
element
.
getAttribute
(
'
href
'
).
replace
(
'
#
'
,
''
);
console
.
log
(
"
got one
"
);
$
(
'
#
'
+
remote
+
'
-popup
'
).
find
(
'
span.t, a.t, li.ui-li-divider
'
).
i18n
();
}
);
gadget_to_translate
.
setEnhanced
(
true
);
}
}
...
...
@@ -201,7 +212,7 @@
$
(
document
).
ready
(
function
()
{
// fallback for old devices which cannot load
<
style
>
css
gadget
=
RenderJs
.
getSelfGadget
()
var
gadget
=
RenderJs
.
getSelfGadget
();
$
(
this
)
.
filter
(
function
()
{
return
$
(
this
).
jqmData
(
"
i18n
"
)
!==
true
;
})
...
...
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