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
81ee271f
Commit
81ee271f
authored
Sep 20, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check for trailing elipsis (issue #116)
parent
4c5e8814
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
docs/usage.rst
docs/usage.rst
+8
-0
weblate/settings_example.py
weblate/settings_example.py
+1
-0
weblate/trans/checks.py
weblate/trans/checks.py
+12
-0
No files found.
docs/usage.rst
View file @
81ee271f
...
...
@@ -227,6 +227,14 @@ correctly spaced. This includes spacing rules for French or Breton.
Exclamation mark is also check in various langauge variants (Chinese,
Japanese, Korean, Armenian, Limbu, Myanmar or Nko).
.. _check-end_elipsis:
Trailing elipsis
++++++++++++++++
Source and translation do not both end with an elipsis. This only checks for
real elipsis (`\u2026`) not for three commas (`...`).
.. _check-python_format:
Python format
...
...
weblate/settings_example.py
View file @
81ee271f
...
...
@@ -317,6 +317,7 @@ CHECK_LIST = (
'weblate.trans.checks.EndColonCheck'
,
'weblate.trans.checks.EndQuestionCheck'
,
'weblate.trans.checks.EndExclamationCheck'
,
'weblate.trans.checks.EndElipsisCheck'
,
'weblate.trans.checks.PythonFormatCheck'
,
'weblate.trans.checks.PHPFormatCheck'
,
'weblate.trans.checks.CFormatCheck'
,
...
...
weblate/trans/checks.py
View file @
81ee271f
...
...
@@ -141,6 +141,7 @@ DEFAULT_CHECK_LIST = (
'
weblate
.
trans
.
checks
.
EndColonCheck
',
'
weblate
.
trans
.
checks
.
EndQuestionCheck
',
'
weblate
.
trans
.
checks
.
EndExclamationCheck
',
'
weblate
.
trans
.
checks
.
EndElipsisCheck
',
'
weblate
.
trans
.
checks
.
PythonFormatCheck
',
'
weblate
.
trans
.
checks
.
PHPFormatCheck
',
'
weblate
.
trans
.
checks
.
CFormatCheck
',
...
...
@@ -401,6 +402,17 @@ class EndExclamationCheck(Check):
return
False
return
self
.
check_chars
(
source
,
target
,
-
1
,
[
u'!'
,
u'!'
,
u'՜'
,
u'᥄'
,
u'႟'
,
u'߹'
])
class
EndElipsisCheck
(
Check
):
'''
Check for elipsis at the end of string.
'''
check_id
=
'end_elipsis'
name
=
_
(
'Trailing elipsis'
)
description
=
_
(
'Source and translation do not both end with an elipsis'
)
def
check_single
(
self
,
source
,
target
,
flags
,
language
,
unit
):
return
self
.
check_chars
(
source
,
target
,
-
1
,
[
u'…'
])
# For now all format string checks use generic implementation, but
# it should be switched to language specific
...
...
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