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
d293d97e
Commit
d293d97e
authored
Feb 28, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View for translating
parent
00b1e961
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
html/translation.html
html/translation.html
+1
-1
trans/models.py
trans/models.py
+6
-1
trans/views.py
trans/views.py
+9
-0
urls.py
urls.py
+1
-0
No files found.
html/translation.html
View file @
d293d97e
...
...
@@ -10,7 +10,7 @@
<h2>
{% trans "Strings to check" %}
</h2>
<ul>
{% for c in checks %}
<li><a
href=
"{{ o
jb
ect.get_translate_url }}?type={{ c.0 }}"
>
{{ c.1 }}
</a></li>
<li><a
href=
"{{ o
bj
ect.get_translate_url }}?type={{ c.0 }}"
>
{{ c.1 }}
</a></li>
{% endfor %}
</ul>
{% endif %}
...
...
trans/models.py
View file @
d293d97e
...
...
@@ -185,8 +185,13 @@ class Translation(models.Model):
'lang'
:
self
.
language
.
code
})
@
models
.
permalink
def
get_translate_url
(
self
):
return
'%stranslate/'
%
self
.
get_absolute_url
()
return
(
'trans.views.translate'
,
(),
{
'project'
:
self
.
subproject
.
project
.
slug
,
'subproject'
:
self
.
subproject
.
slug
,
'lang'
:
self
.
language
.
code
})
def
__unicode__
(
self
):
return
'%s %s'
%
(
self
.
language
.
name
,
self
.
subproject
.
__unicode__
())
...
...
trans/views.py
View file @
d293d97e
...
...
@@ -27,3 +27,12 @@ def show_translation(request, project, subproject, lang):
'title'
:
'%s @ Weblate'
%
(
obj
.
__unicode__
()),
}))
def
translate
(
request
,
project
,
subproject
,
lang
):
obj
=
get_object_or_404
(
Translation
,
language__code
=
lang
,
subproject__slug
=
subproject
,
subproject__project__slug
=
project
)
return
render_to_response
(
'translate.html'
,
RequestContext
(
request
,
{
'object'
:
obj
,
'title'
:
'%s @ Weblate'
%
(
obj
.
__unicode__
()),
}))
urls.py
View file @
d293d97e
...
...
@@ -12,4 +12,5 @@ urlpatterns = patterns('',
url
(
r'^(?P<project>[^/]*)/$'
,
'trans.views.show_project'
),
url
(
r'^(?P<project>[^/]*)/(?P<subproject>[^/]*)/$'
,
'trans.views.show_subproject'
),
url
(
r'^(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/$'
,
'trans.views.show_translation'
),
url
(
r'^(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/translate/$'
,
'trans.views.translate'
),
)
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