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
ed2fa5d0
Commit
ed2fa5d0
authored
Jan 21, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap some long lines
parent
27beda9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
6 deletions
+47
-6
weblate/trans/checks/chars.py
weblate/trans/checks/chars.py
+6
-1
weblate/trans/checks/consistency.py
weblate/trans/checks/consistency.py
+2
-1
weblate/trans/checks/format.py
weblate/trans/checks/format.py
+39
-4
No files found.
weblate/trans/checks/chars.py
View file @
ed2fa5d0
...
...
@@ -135,7 +135,12 @@ class EndColonCheck(TargetCheck):
# Japanese sentence might need to end with full stop
# in case it's used before list.
if
source
[
-
1
]
in
[
':'
,
';'
]:
return
self
.
check_chars
(
source
,
target
,
-
1
,
[
u':'
,
u':'
,
u'.'
,
u'。'
])
return
self
.
check_chars
(
source
,
target
,
-
1
,
[
u':'
,
u':'
,
u'.'
,
u'。'
]
)
return
False
return
self
.
check_chars
(
source
,
target
,
-
1
,
[
u':'
,
u':'
])
...
...
weblate/trans/checks/consistency.py
View file @
ed2fa5d0
...
...
@@ -54,9 +54,10 @@ class ConsistencyCheck(TargetCheck):
# Do not check consistency if user asked not to have it
if
not
unit
.
translation
.
subproject
.
allow_translation_propagation
:
return
False
project
=
unit
.
translation
.
subproject
.
project
,
related
=
Unit
.
objects
.
filter
(
translation__language
=
language
,
translation__subproject__project
=
unit
.
translation
.
subproject
.
project
,
translation__subproject__project
=
project
,
checksum
=
unit
.
checksum
,
).
exclude
(
id
=
unit
.
id
,
...
...
weblate/trans/checks/format.py
View file @
ed2fa5d0
...
...
@@ -81,19 +81,54 @@ class BaseFormatCheck(TargetCheck):
return
False
# Special case languages with single plural form
if
len
(
sources
)
>
1
and
len
(
targets
)
==
1
:
return
self
.
check_format
(
sources
[
1
],
targets
[
0
],
flags
,
language
,
unit
,
1
,
False
)
return
self
.
check_format
(
sources
[
1
],
targets
[
0
],
flags
,
language
,
unit
,
1
,
False
)
# Check singular
if
self
.
check_format
(
sources
[
0
],
targets
[
0
],
flags
,
language
,
unit
,
0
,
len
(
sources
)
>
1
):
singular_check
=
self
.
check_format
(
sources
[
0
],
targets
[
0
],
flags
,
language
,
unit
,
0
,
len
(
sources
)
>
1
)
if
singular_check
:
if
len
(
sources
)
==
1
:
return
True
if
self
.
check_format
(
sources
[
1
],
targets
[
0
],
flags
,
language
,
unit
,
1
,
True
):
plural_check
=
self
.
check_format
(
sources
[
1
],
targets
[
0
],
flags
,
language
,
unit
,
1
,
True
)
if
plural_check
:
return
True
# Do we have more to check?
if
len
(
sources
)
==
1
:
return
False
# Check plurals against plural from source
for
target
in
targets
[
1
:]:
if
self
.
check_format
(
sources
[
1
],
target
,
flags
,
language
,
unit
,
1
,
False
):
plural_check
=
self
.
check_format
(
sources
[
1
],
target
,
flags
,
language
,
unit
,
1
,
False
)
if
plural_check
:
return
True
# Check did not fire
return
False
...
...
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