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
269920bd
Commit
269920bd
authored
Apr 08, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
d1cb4e3b
afec0c03
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
449 additions
and
0 deletions
+449
-0
trans/migrations/0028_auto__chg_field_subproject_push.py
trans/migrations/0028_auto__chg_field_subproject_push.py
+19
-0
trans/migrations/0029_auto__add_field_translation_failing_checks.py
...ations/0029_auto__add_field_translation_failing_checks.py
+207
-0
trans/migrations/0030_update_failing_checks.py
trans/migrations/0030_update_failing_checks.py
+212
-0
trans/models/translation.py
trans/models/translation.py
+8
-0
trans/models/unit.py
trans/models/unit.py
+3
-0
No files found.
trans/migrations/0028_auto__chg_field_subproject_push.py
View file @
269920bd
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import
datetime
from
south.db
import
db
from
south.v2
import
SchemaMigration
...
...
trans/migrations/0029_auto__add_field_translation_failing_checks.py
0 → 100644
View file @
269920bd
This diff is collapsed.
Click to expand it.
trans/migrations/0030_update_failing_checks.py
0 → 100644
View file @
269920bd
This diff is collapsed.
Click to expand it.
trans/models/translation.py
View file @
269920bd
...
...
@@ -86,6 +86,7 @@ class Translation(models.Model):
translated
=
models
.
IntegerField
(
default
=
0
,
db_index
=
True
)
fuzzy
=
models
.
IntegerField
(
default
=
0
,
db_index
=
True
)
total
=
models
.
IntegerField
(
default
=
0
,
db_index
=
True
)
failing_checks
=
models
.
IntegerField
(
default
=
0
,
db_index
=
True
)
enabled
=
models
.
BooleanField
(
default
=
True
,
db_index
=
True
)
...
...
@@ -534,6 +535,10 @@ class Translation(models.Model):
# Update revision and stats
self
.
update_stats
()
# Cleanup checks cache if there were some deleted units
if
len
(
deleted_checksums
)
>
0
:
self
.
invalidate_cache
()
# Store change entry
if
request
is
None
:
user
=
None
...
...
@@ -591,6 +596,9 @@ class Translation(models.Model):
self
.
total
=
self
.
unit_set
.
count
()
self
.
fuzzy
=
self
.
unit_set
.
filter
(
fuzzy
=
True
).
count
()
self
.
translated
=
self
.
unit_set
.
filter
(
translated
=
True
).
count
()
self
.
failing_checks
=
self
.
filter_checks
(
'allchecks'
,
translation
).
count
()
self
.
save
()
self
.
store_hash
()
...
...
trans/models/unit.py
View file @
269920bd
...
...
@@ -168,6 +168,8 @@ class UnitManager(models.Manager):
return
translation
.
fuzzy
elif
rqtype
==
'untranslated'
:
return
translation
.
total
-
translation
.
translated
elif
rqtype
==
'allchecks'
:
return
translation
.
failing_checks
# Try to get value from cache
cache_key
=
'counts-%s-%s-%s'
%
(
...
...
@@ -793,6 +795,7 @@ class Unit(models.Model):
# Delete all checks if only message with this source is fuzzy
if
not
same_source
.
exists
():
self
.
checks
().
delete
()
self
.
translation
.
invalidate_cache
()
return
# If there is no consistency checking, we can return
...
...
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