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
36384184
Commit
36384184
authored
Mar 15, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add blacklist for some frequently not translated words
parent
47e0bf47
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
docs/usage.rst
docs/usage.rst
+2
-0
trans/checks.py
trans/checks.py
+35
-0
No files found.
docs/usage.rst
View file @
36384184
...
@@ -116,6 +116,8 @@ Not translated
...
@@ -116,6 +116,8 @@ Not translated
++++++++++++++
++++++++++++++
The source and translated strings are same at least in one of plural forms.
The source and translated strings are same at least in one of plural forms.
This checks ignores some strings which are quite usually same in all
languages.
.. _check-begin_newline:
.. _check-begin_newline:
...
...
trans/checks.py
View file @
36384184
...
@@ -36,6 +36,39 @@ C_PRINTF_MATCH = re.compile('''
...
@@ -36,6 +36,39 @@ C_PRINTF_MATCH = re.compile('''
(?P<type>[
\
w%])) #
t
ype (%s, %d, etc.)
(?P<type>[
\
w%])) #
t
ype (%s, %d, etc.)
)'''
,
re
.
VERBOSE
)
)'''
,
re
.
VERBOSE
)
# We ignore some words which are usually not translated
SAME_BLACKLIST
=
[
'b'
,
'bzip2'
,
'data'
,
'e-mail'
,
'eib'
,
'export'
,
'firmware'
,
'gib'
,
'gzip'
,
'id'
,
'imei'
,
'import'
,
'kib'
,
'latex'
,
'mib'
,
'ok'
,
'open document'
,
'pdf'
,
'pib'
,
'port'
,
'server'
,
'sim'
,
'smsc'
,
'software'
,
'sql'
,
'text'
,
'tib'
,
'wiki'
,
'xml'
,
'zip'
,
]
CHECKS
=
{}
CHECKS
=
{}
...
@@ -61,6 +94,8 @@ def plural_check(f):
...
@@ -61,6 +94,8 @@ def plural_check(f):
def
check_same
(
source
,
target
,
flags
,
language
):
def
check_same
(
source
,
target
,
flags
,
language
):
if
language
.
code
.
split
(
'_'
)[
0
]
==
'en'
:
if
language
.
code
.
split
(
'_'
)[
0
]
==
'en'
:
return
False
return
False
if
source
.
lower
()
in
SAME_BLACKLIST
:
return
False
return
(
source
==
target
)
return
(
source
==
target
)
CHECKS
[
'same'
]
=
(
_
(
'Not translated'
),
check_same
,
_
(
'Source and translated strings are same'
))
CHECKS
[
'same'
]
=
(
_
(
'Not translated'
),
check_same
,
_
(
'Source and translated strings are same'
))
...
...
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