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
f30edc77
Commit
f30edc77
authored
Feb 28, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore copyright statements from checks
parent
b4431ebb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
trans/checks/same.py
trans/checks/same.py
+7
-1
trans/tests/same_checks.py
trans/tests/same_checks.py
+18
-0
No files found.
trans/checks/same.py
View file @
f30edc77
...
...
@@ -148,6 +148,12 @@ class SameCheck(TargetCheck):
if
len
(
source
.
strip
(
'0123456789:/,.'
))
<=
1
:
return
False
lower_source
=
source
.
lower
()
# Skip copyright
if
'(c) copyright'
in
lower_source
or
u'©'
in
source
:
return
False
# Ignore strings which don't contain any string to translate
if
self
.
is_format_only
(
source
,
flags
):
return
False
...
...
@@ -161,7 +167,7 @@ class SameCheck(TargetCheck):
return
False
# Ignore words which are often same in foreigh language
if
source
.
lower
()
.
strip
(
'_&: '
)
in
SAME_BLACKLIST
:
if
lower_source
.
strip
(
'_&: '
)
in
SAME_BLACKLIST
:
return
False
return
(
source
==
target
)
trans/tests/same_checks.py
View file @
f30edc77
...
...
@@ -49,3 +49,21 @@ class SameCheckTest(CheckTestCase):
def
test_same_numbers
(
self
):
self
.
do_test
(
False
,
(
'1:4'
,
'1:4'
,
''
))
def
test_same_copyright
(
self
):
self
.
do_test
(
False
,
(
u'(c) Copyright 2013 Michal Čihař'
,
u'(c) Copyright 2013 Michal Čihař'
,
''
)
)
self
.
do_test
(
False
,
(
u'© Copyright 2013 Michal Čihař'
,
u'© Copyright 2013 Michal Čihař'
,
''
)
)
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