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
1bacf959
Commit
1bacf959
authored
Mar 27, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicit notion of abstract classes
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
3805ec70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
2 deletions
+44
-2
weblate/trans/checks/base.py
weblate/trans/checks/base.py
+26
-2
weblate/trans/checks/consistency.py
weblate/trans/checks/consistency.py
+12
-0
weblate/trans/checks/format.py
weblate/trans/checks/format.py
+6
-0
No files found.
weblate/trans/checks/base.py
View file @
1bacf959
...
...
@@ -65,13 +65,13 @@ class Check(object):
'''
Check for single phrase, not dealing with plurals.
'''
r
eturn
False
r
aise
NotImplementedError
()
def
check_source
(
self
,
source
,
unit
):
'''
Checks source string
'''
r
eturn
False
r
aise
NotImplementedError
()
def
check_chars
(
self
,
source
,
target
,
pos
,
chars
):
'''
...
...
@@ -130,6 +130,18 @@ class TargetCheck(Check):
'''
target
=
True
def
check_source
(
self
,
source
,
unit
):
'''
We don't check source strings here.
'''
return
False
def
check_single
(
self
,
source
,
target
,
unit
,
cache_slot
):
'''
Check for single phrase, not dealing with plurals.
'''
raise
NotImplementedError
()
class
SourceCheck
(
Check
):
'''
...
...
@@ -137,6 +149,18 @@ class SourceCheck(Check):
'''
source
=
True
def
check_single
(
self
,
source
,
target
,
unit
,
cache_slot
):
'''
We don't check target strings here.
'''
return
False
def
check_source
(
self
,
source
,
unit
):
'''
Checks source string
'''
raise
NotImplementedError
()
class
CountingCheck
(
TargetCheck
):
'''
...
...
weblate/trans/checks/consistency.py
View file @
1bacf959
...
...
@@ -40,6 +40,12 @@ class PluralsCheck(TargetCheck):
# Check for empty translation
return
''
in
targets
def
check_single
(
self
,
source
,
target
,
unit
,
cache_slot
):
'''
We don't check target strings here.
'''
return
False
class
ConsistencyCheck
(
TargetCheck
):
'''
...
...
@@ -72,3 +78,9 @@ class ConsistencyCheck(TargetCheck):
return
True
return
False
def
check_single
(
self
,
source
,
target
,
unit
,
cache_slot
):
'''
We don't check target strings here.
'''
return
False
weblate/trans/checks/format.py
View file @
1bacf959
...
...
@@ -206,6 +206,12 @@ class BaseFormatCheck(TargetCheck):
def
is_position_based
(
self
,
string
):
return
True
def
check_single
(
self
,
source
,
target
,
unit
,
cache_slot
):
'''
We don't check target strings here.
'''
return
False
class
PythonFormatCheck
(
BaseFormatCheck
):
'''
...
...
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