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
51f4861c
Commit
51f4861c
authored
Oct 30, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better structure code
parent
429b3583
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
weblate/trans/models.py
weblate/trans/models.py
+17
-3
No files found.
weblate/trans/models.py
View file @
51f4861c
...
...
@@ -1790,9 +1790,12 @@ class Translation(models.Model):
Returns list of failing source checks on current subproject.
'''
result
=
[(
'all'
,
_
(
'All strings'
))]
# All checks
sourcechecks
=
self
.
unit_set
.
count_type
(
'sourcechecks'
,
self
)
if
sourcechecks
>
0
:
result
.
append
((
'sourcechecks'
,
_
(
'Strings with any failing checks (%d)'
)
%
sourcechecks
))
return
result
def
get_translation_checks
(
self
):
...
...
@@ -1800,18 +1803,28 @@ class Translation(models.Model):
Returns list of failing checks on current translation.
'''
result
=
[(
'all'
,
_
(
'All strings'
))]
# Not translated strings
nottranslated
=
self
.
unit_set
.
count_type
(
'untranslated'
,
self
)
fuzzy
=
self
.
unit_set
.
count_type
(
'fuzzy'
,
self
)
suggestions
=
self
.
unit_set
.
count_type
(
'suggestions'
,
self
)
allchecks
=
self
.
unit_set
.
count_type
(
'allchecks'
,
self
)
if
nottranslated
>
0
:
result
.
append
((
'untranslated'
,
_
(
'Not translated strings (%d)'
)
%
nottranslated
))
# Fuzzy strings
fuzzy
=
self
.
unit_set
.
count_type
(
'fuzzy'
,
self
)
if
fuzzy
>
0
:
result
.
append
((
'fuzzy'
,
_
(
'Fuzzy strings (%d)'
)
%
fuzzy
))
# Translations with suggestions
suggestions
=
self
.
unit_set
.
count_type
(
'suggestions'
,
self
)
if
suggestions
>
0
:
result
.
append
((
'suggestions'
,
_
(
'Strings with suggestions (%d)'
)
%
suggestions
))
# All checks
allchecks
=
self
.
unit_set
.
count_type
(
'allchecks'
,
self
)
if
allchecks
>
0
:
result
.
append
((
'allchecks'
,
_
(
'Strings with any failing checks (%d)'
)
%
allchecks
))
# Process specific checks
for
check
in
CHECKS
:
if
not
CHECKS
[
check
].
target
:
continue
...
...
@@ -1819,6 +1832,7 @@ class Translation(models.Model):
if
cnt
>
0
:
desc
=
CHECKS
[
check
].
description
+
(
' (%d)'
%
cnt
)
result
.
append
((
check
,
desc
))
return
result
def
merge_store
(
self
,
author
,
store2
,
overwrite
,
mergefuzzy
=
False
,
merge_header
=
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