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
b5845b25
Commit
b5845b25
authored
May 11, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nicer formatting of strings to check
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
997d9ce2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
weblate/html/translation.html
weblate/html/translation.html
+7
-3
weblate/trans/models/translation.py
weblate/trans/models/translation.py
+12
-7
No files found.
weblate/html/translation.html
View file @
b5845b25
...
...
@@ -26,11 +26,15 @@
{% with object.get_translation_checks as checks%}
{% if checks %}
<h2>
{% trans "Strings to check" %}
</h2>
<ul>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"list-group"
>
{% for c in checks %}
<
li><a
href=
"{{ object.get_translate_url }}?type={{ c.0 }}"
>
{{ c.1 }}
</a></li
>
<
a
class=
"list-group-item"
href=
"{{ object.get_translate_url }}?type={{ c.0 }}"
><span
class=
"badge"
>
{{ c.2 }}
</span>
{{ c.1 }}
</a
>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endif %}
{% endwith %}
...
...
weblate/trans/models/translation.py
View file @
b5845b25
...
...
@@ -1045,14 +1045,15 @@ class Translation(models.Model, URLMixin, PercentMixin):
'''
Returns list of failing checks on current translation.
'''
result
=
[(
'all'
,
_
(
'All strings'
))]
result
=
[(
'all'
,
_
(
'All strings'
)
,
self
.
total
)]
# Untranslated strings
nottranslated
=
self
.
unit_set
.
count_type
(
'untranslated'
,
self
)
if
nottranslated
>
0
:
result
.
append
((
'untranslated'
,
_
(
'Untranslated strings (%d)'
)
%
nottranslated
_
(
'Untranslated strings (%d)'
)
%
nottranslated
,
nottranslated
,
))
# Fuzzy strings
...
...
@@ -1060,21 +1061,24 @@ class Translation(models.Model, URLMixin, PercentMixin):
if
fuzzy
>
0
:
result
.
append
((
'fuzzy'
,
_
(
'Fuzzy strings (%d)'
)
%
fuzzy
_
(
'Fuzzy strings (%d)'
)
%
fuzzy
,
fuzzy
,
))
# Translations with suggestions
if
self
.
have_suggestion
>
0
:
result
.
append
((
'suggestions'
,
_
(
'Strings with suggestions (%d)'
)
%
self
.
have_suggestion
_
(
'Strings with suggestions (%d)'
)
%
self
.
have_suggestion
,
self
.
have_suggestion
,
))
# All checks
if
self
.
failing_checks
>
0
:
result
.
append
((
'allchecks'
,
_
(
'Strings with any failing checks (%d)'
)
%
self
.
failing_checks
_
(
'Strings with any failing checks (%d)'
)
%
self
.
failing_checks
,
self
.
failing_checks
,
))
# Process specific checks
...
...
@@ -1084,14 +1088,15 @@ class Translation(models.Model, URLMixin, PercentMixin):
cnt
=
self
.
unit_set
.
count_type
(
check
,
self
)
if
cnt
>
0
:
desc
=
CHECKS
[
check
].
description
+
(
' (%d)'
%
cnt
)
result
.
append
((
check
,
desc
))
result
.
append
((
check
,
desc
,
cnt
))
# Grab comments
targetcomments
=
self
.
unit_set
.
count_type
(
'targetcomments'
,
self
)
if
targetcomments
>
0
:
result
.
append
((
'targetcomments'
,
_
(
'Strings with comments (%d)'
)
%
targetcomments
_
(
'Strings with comments (%d)'
)
%
targetcomments
,
targetcomments
,
))
return
result
...
...
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