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
3c101db5
Commit
3c101db5
authored
Oct 10, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add source check for more failing checks (closes #385)
parent
074ff5d4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
docs/user/checks.rst
docs/user/checks.rst
+12
-0
trans/checks/source.py
trans/checks/source.py
+21
-0
weblate/appsettings.py
weblate/appsettings.py
+1
-0
weblate/settings_example.py
weblate/settings_example.py
+1
-0
No files found.
docs/user/checks.rst
View file @
3c101db5
...
@@ -236,3 +236,15 @@ The string uses three dots (...) instead of an ellipsis character (…). Using
...
@@ -236,3 +236,15 @@ The string uses three dots (...) instead of an ellipsis character (…). Using
Unicode character is in most cases better approach and looks better.
Unicode character is in most cases better approach and looks better.
.. seealso:: https://en.wikipedia.org/wiki/Ellipsis
.. seealso:: https://en.wikipedia.org/wiki/Ellipsis
.. _check-multiple-failures:
Multiple failing checks
~~~~~~~~~~~~~~~~~~~~~~~
More translations of this string have some failed quality checks. This is
usually indication that something could be done about improving the source
string.
This check can be quite often caused by missing full stop at the end of
sentence or similar minor issues which translators tend to fix in translations.
trans/checks/source.py
View file @
3c101db5
...
@@ -55,3 +55,24 @@ class EllipsisCheck(SourceCheck):
...
@@ -55,3 +55,24 @@ class EllipsisCheck(SourceCheck):
def
check_source
(
self
,
source
,
unit
):
def
check_source
(
self
,
source
,
unit
):
return
'...'
in
source
[
0
]
return
'...'
in
source
[
0
]
class
MultipleFailingCheck
(
SourceCheck
):
'''
Checks whether there are more failing checks on this translation.
'''
check_id
=
'multiple_failures'
name
=
_
(
'Multiple failing checks'
)
description
=
_
(
'Translation in several languages have failing checks.'
)
def
check_source
(
self
,
source
,
unit
):
from
trans.models.unitdata
import
Check
related
=
Check
.
objects
.
filter
(
contentsum
=
unit
.
contentsum
,
project
=
unit
.
translation
.
subproject
.
project
).
exclude
(
language__isnull
=
True
)
return
related
.
count
()
>
2
weblate/appsettings.py
View file @
3c101db5
...
@@ -116,6 +116,7 @@ CHECK_LIST = get('CHECK_LIST', (
...
@@ -116,6 +116,7 @@ CHECK_LIST = get('CHECK_LIST', (
'trans.checks.markup.XMLTagsCheck'
,
'trans.checks.markup.XMLTagsCheck'
,
'trans.checks.source.OptionalPluralCheck'
,
'trans.checks.source.OptionalPluralCheck'
,
'trans.checks.source.EllipsisCheck'
,
'trans.checks.source.EllipsisCheck'
,
'trans.checks.source.MultipleFailingCheck'
,
))
))
# List of automatic fixups
# List of automatic fixups
...
...
weblate/settings_example.py
View file @
3c101db5
...
@@ -449,6 +449,7 @@ WHOOSH_INDEX = os.path.join(WEB_ROOT, 'whoosh-index')
...
@@ -449,6 +449,7 @@ WHOOSH_INDEX = os.path.join(WEB_ROOT, 'whoosh-index')
# 'trans.checks.markup.XMLTagsCheck',
# 'trans.checks.markup.XMLTagsCheck',
# 'trans.checks.source.OptionalPluralCheck',
# 'trans.checks.source.OptionalPluralCheck',
# 'trans.checks.source.EllipsisCheck',
# 'trans.checks.source.EllipsisCheck',
# 'trans.checks.source.MultipleFailingCheck',
#)
#)
# List of automatic fixups
# List of automatic fixups
...
...
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