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
66cb0464
Commit
66cb0464
authored
Oct 23, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepared infrastructure to source review and comments (issue #121)
parent
7dee91df
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
weblate/trans/models.py
weblate/trans/models.py
+14
-0
weblate/trans/views.py
weblate/trans/views.py
+24
-0
weblate/urls.py
weblate/urls.py
+2
-0
No files found.
weblate/trans/models.py
View file @
66cb0464
...
...
@@ -1331,6 +1331,13 @@ class Translation(models.Model):
'lang'
:
self
.
language
.
code
})
@
models
.
permalink
def
get_source_review_url
(
self
):
return
(
'weblate.trans.views.review_source'
,
(),
{
'project'
:
self
.
subproject
.
project
.
slug
,
'subproject'
:
self
.
subproject
.
slug
,
})
def
__unicode__
(
self
):
return
'%s - %s'
%
(
self
.
subproject
.
__unicode__
(),
_
(
self
.
language
.
name
))
...
...
@@ -1766,6 +1773,13 @@ class Translation(models.Model):
return
need_save
,
pounit
def
get_source_checks
(
self
):
'''
Returns list of failing source checks on current subproject.
'''
result
=
[(
'all'
,
_
(
'All strings'
))]
return
result
def
get_translation_checks
(
self
):
'''
Returns list of failing checks on current translation.
...
...
weblate/trans/views.py
View file @
66cb0464
...
...
@@ -421,6 +421,30 @@ def auto_translation(request, project, subproject, lang):
return
HttpResponseRedirect
(
obj
.
get_absolute_url
())
def
review_source
(
request
,
project
,
subproject
):
'''
Listing of source strings to review.
'''
obj
=
get_object_or_404
(
SubProject
,
slug
=
subproject
,
project__slug
=
project
)
def
show_source
(
request
,
project
,
subproject
):
'''
Show source strings summary and checks.
'''
obj
=
get_object_or_404
(
SubProject
,
slug
=
subproject
,
project__slug
=
project
)
if
not
obj
.
translation_set
.
exists
():
raise
Http404
(
'No translation exists in this subproject.'
)
# Grab first translation in subproject
# (this assumes all have same source strings)
source
=
obj
.
translation_set
.
all
()[
0
]
return
render_to_response
(
'source.html'
,
RequestContext
(
request
,
{
'object'
:
obj
,
'source'
:
source
,
'title'
:
_
(
'Source strings in %s'
)
%
obj
.
__unicode__
(),
}))
def
show_translation
(
request
,
project
,
subproject
,
lang
):
obj
=
get_object_or_404
(
Translation
,
language__code
=
lang
,
subproject__slug
=
subproject
,
subproject__project__slug
=
project
,
enabled
=
True
)
last_changes
=
Change
.
objects
.
filter
(
unit__translation
=
obj
).
order_by
(
'-timestamp'
)[:
10
]
...
...
weblate/urls.py
View file @
66cb0464
...
...
@@ -54,6 +54,8 @@ urlpatterns = patterns('',
url
(
r'^dictionaries/(?P<project>[^/]*)/(?P<lang>[^/]*)/download/$'
,
'weblate.trans.views.download_dictionary'
),
url
(
r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/$'
,
'weblate.trans.views.show_subproject'
),
url
(
r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/source/$'
,
'weblate.trans.views.show_source'
),
url
(
r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/source/review/$'
,
'weblate.trans.views.review_source'
),
url
(
r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/$'
,
'weblate.trans.views.show_translation'
),
url
(
r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/translate/$'
,
'weblate.trans.views.translate'
),
url
(
r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/download/$'
,
'weblate.trans.views.download_translation'
),
...
...
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