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
028ce54f
Commit
028ce54f
authored
Oct 06, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into bootstrap
parents
7ebe4133
132491e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
weblate/trans/checks/same.py
weblate/trans/checks/same.py
+28
-0
weblate/trans/tests/test_checks.py
weblate/trans/tests/test_checks.py
+3
-1
weblate/trans/tests/test_same_checks.py
weblate/trans/tests/test_same_checks.py
+14
-0
No files found.
weblate/trans/checks/same.py
View file @
028ce54f
...
...
@@ -36,6 +36,7 @@ SAME_BLACKLIST = frozenset((
'active'
,
'add-ons'
,
'addons'
,
'address'
,
'admin'
,
'administration'
,
'ah'
,
...
...
@@ -78,6 +79,7 @@ SAME_BLACKLIST = frozenset((
'bluetooth'
,
'bootloader'
,
'branch'
,
'broadcast'
,
'browser'
,
'buffer'
,
'byte'
,
...
...
@@ -173,6 +175,7 @@ SAME_BLACKLIST = frozenset((
'filter'
,
'filters'
,
'finance'
,
'firewall'
,
'firmware'
,
'flash'
,
'flattr'
,
...
...
@@ -223,9 +226,11 @@ SAME_BLACKLIST = frozenset((
'http'
,
'hut'
,
'hyperlink'
,
'icmp'
,
'icon'
,
'icons'
,
'id'
,
'ids'
,
'idea'
,
'ignore'
,
'irc'
,
...
...
@@ -246,6 +251,7 @@ SAME_BLACKLIST = frozenset((
'innodb'
,
'ins'
,
'insert'
,
'install'
,
'installation'
,
'interlingua'
,
'internet'
,
...
...
@@ -253,6 +259,8 @@ SAME_BLACKLIST = frozenset((
'introduction'
,
'ion'
,
'ios'
,
'ip6tables'
,
'iptables'
,
'irix'
,
'isbn'
,
'ismn'
,
...
...
@@ -287,6 +295,7 @@ SAME_BLACKLIST = frozenset((
'lock'
,
'local'
,
'locales'
,
'logcheck'
,
'login'
,
'logo'
,
'logos'
,
...
...
@@ -343,6 +352,9 @@ SAME_BLACKLIST = frozenset((
'namecoin'
,
'namecoins'
,
'navigation'
,
'net'
,
'netfilter'
,
'network'
,
'neutral'
,
'nimh'
,
'no'
,
...
...
@@ -397,6 +409,7 @@ SAME_BLACKLIST = frozenset((
'php'
,
'phpmyadmin'
,
'pib'
,
'ping'
,
'pirate'
,
'pirates'
,
'placement'
,
...
...
@@ -428,6 +441,7 @@ SAME_BLACKLIST = frozenset((
'promotion'
,
'property'
,
'properties'
,
'protocol'
,
'provider'
,
'proxy'
,
'pt'
,
...
...
@@ -476,6 +490,7 @@ SAME_BLACKLIST = frozenset((
'scripting'
,
'scroll'
,
'seed'
,
'selinux'
,
'send'
,
'sergeant'
,
'serie'
,
...
...
@@ -496,6 +511,7 @@ SAME_BLACKLIST = frozenset((
'smsd'
,
'snapshot'
,
'snapshots'
,
'snmp'
,
'socket'
,
'software'
,
'solaris'
,
...
...
@@ -842,6 +858,12 @@ SPLIT_RE = re.compile(
ur'
[()
,.
^
`
"
\
'
\
\
/_<>!?;:|{}*^@%#&~=+
\
r
\
n
✓—…
\
[
\
]0-9-])+'
)
# Docbook tags to ignore
DB_TAGS = (
'screen',
'indexterm',
'programlisting',
)
def strip_format(msg, flags):
'''
...
...
@@ -919,6 +941,12 @@ class SameCheck(TargetCheck):
if result is not None:
return result
# Ignore some docbook tags
if unit.comment.startswith('Tag: '):
if unit.comment[5:] in DB_TAGS:
self.set_cache(unit, True, cache_slot)
return True
# Lower case source
lower_source = source.lower()
...
...
weblate/trans/tests/test_checks.py
View file @
028ce54f
...
...
@@ -64,7 +64,8 @@ class MockUnit(object):
'''
Mock unit object.
'''
def
__init__
(
self
,
checksum
=
None
,
flags
=
''
,
code
=
'cs'
,
source
=
''
):
def
__init__
(
self
,
checksum
=
None
,
flags
=
''
,
code
=
'cs'
,
source
=
''
,
comment
=
''
):
if
checksum
is
None
:
checksum
=
str
(
uuid
.
uuid1
())
self
.
checksum
=
checksum
...
...
@@ -73,6 +74,7 @@ class MockUnit(object):
self
.
source
=
source
self
.
fuzzy
=
False
self
.
translated
=
True
self
.
comment
=
comment
@
property
def
all_flags
(
self
):
...
...
weblate/trans/tests/test_same_checks.py
View file @
028ce54f
...
...
@@ -46,6 +46,20 @@ class SameCheckTest(CheckTestCase):
0
))
def
test_same_db_screen
(
self
):
self
.
assertTrue
(
self
.
check
.
check_single
(
'some long text is here'
,
'some long text is here'
,
MockUnit
(
code
=
'de'
),
0
))
self
.
assertFalse
(
self
.
check
.
check_single
(
'some long text is here'
,
'some long text is here'
,
MockUnit
(
code
=
'de'
,
comment
=
'Tag: screen'
),
0
))
def
test_same_numbers
(
self
):
self
.
do_test
(
False
,
(
'1:4'
,
'1:4'
,
''
))
self
.
do_test
(
False
,
(
'1, 3, 10'
,
'1, 3, 10'
,
''
))
...
...
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