Commit 81ee271f authored by Michal Čihař's avatar Michal Čihař

Add check for trailing elipsis (issue #116)

parent 4c5e8814
......@@ -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
......
......@@ -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',
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment