Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
92a5a6c3
Commit
92a5a6c3
authored
Mar 02, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add copying of text to translation
parent
0820b908
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
0 deletions
+23
-0
html/translate.html
html/translate.html
+4
-0
media/css/style.css
media/css/style.css
+4
-0
media/js/loader.js
media/js/loader.js
+6
-0
trans/views.py
trans/views.py
+7
-0
urls.py
urls.py
+2
-0
No files found.
html/translate.html
View file @
92a5a6c3
...
...
@@ -27,6 +27,10 @@
<td
class=
"translatetext"
>
{{ unit.source|fmttranslation }}
</td>
</tr>
<tr>
<td></td>
<td><a
href=
"#"
id=
"copy-text"
>
{% trans "Copy" %}
</td>
</tr>
<tr>
<th>
{% if unit.is_plural %}{% trans "Translations" %}{% else %}{% trans "Translation" %}{% endif %}
</th>
<td
class=
"translator"
>
{{ form.checksum }}
...
...
media/css/style.css
View file @
92a5a6c3
...
...
@@ -71,3 +71,7 @@ td.translator textarea {
td
.suggestions
table
{
width
:
100%
}
#copy-text
{
width
:
20px
;
height
:
20px
;
}
media/js/loader.js
View file @
92a5a6c3
...
...
@@ -5,4 +5,10 @@ $(document).ready(function(){
$
(
'
.sug-accept
'
).
button
({
text
:
false
,
icons
:
{
primary
:
"
ui-icon-check
"
}});
$
(
'
.sug-delete
'
).
button
({
text
:
false
,
icons
:
{
primary
:
"
ui-icon-close
"
}});
$
(
'
#id_target
'
).
change
(
function
f
()
{
$
(
'
#id_fuzzy
'
).
attr
(
'
checked
'
,
false
);}).
focus
();
$
(
'
#copy-text
'
).
button
({
text
:
false
,
icons
:
{
primary
:
"
ui-icon-arrowthick-1-s
"
}}).
click
(
function
f
()
{
$
.
get
(
"
/js/get/
"
+
$
(
'
#id_checksum
'
).
attr
(
'
value
'
)
+
'
/
'
,
function
(
data
)
{
$
(
'
#id_target
'
).
text
(
data
);
});
return
false
;
});
});
trans/views.py
View file @
92a5a6c3
...
...
@@ -157,3 +157,10 @@ def translate(request, project, subproject, lang):
'type'
:
rqtype
,
'form'
:
form
,
}))
def
get_string
(
request
,
checksum
):
units
=
Unit
.
objects
.
filter
(
checksum
=
checksum
)
if
units
.
count
()
==
0
:
return
HttpResponse
(
''
)
return
HttpResponse
(
units
[
0
].
get_source_plurals
()[
0
])
urls.py
View file @
92a5a6c3
...
...
@@ -10,6 +10,8 @@ urlpatterns = patterns('',
url
(
r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/translate/$'
,
'trans.views.translate'
),
url
(
r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/download/$'
,
'trans.views.download_translation'
),
url
(
r'^js/get/(?P<checksum>[^/]*)/$'
,
'trans.views.get_string'
),
# Admin interface
url
(
r'^admin/doc/'
,
include
(
'django.contrib.admindocs.urls'
)),
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
...
...
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