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
39eb8727
Commit
39eb8727
authored
Apr 16, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup imports
parent
fe1c71a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
weblate/trans/checks.py
weblate/trans/checks.py
+2
-2
weblate/trans/context_processors.py
weblate/trans/context_processors.py
+2
-2
weblate/trans/models.py
weblate/trans/models.py
+12
-12
No files found.
weblate/trans/checks.py
View file @
39eb8727
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.exceptions
import
ImproperlyConfigured
from
django.conf
import
settings
from
django.conf
import
settings
import
trans
import
weblate
import
re
import
re
PYTHON_PRINTF_MATCH
=
re
.
compile
(
'''
PYTHON_PRINTF_MATCH
=
re
.
compile
(
'''
...
@@ -198,7 +198,7 @@ class Check(object):
...
@@ -198,7 +198,7 @@ class Check(object):
Returns link to documentation.
Returns link to documentation.
'''
'''
return
'http://weblate.readthedocs.org/en/weblate-%s/usage.html#check-%s'
%
(
return
'http://weblate.readthedocs.org/en/weblate-%s/usage.html#check-%s'
%
(
trans
.
VERSION
,
weblate
.
VERSION
,
self
.
check_id
,
self
.
check_id
,
)
)
...
...
weblate/trans/context_processors.py
View file @
39eb8727
import
trans
import
weblate
from
django.conf
import
settings
from
django.conf
import
settings
from
datetime
import
datetime
from
datetime
import
datetime
def
version
(
request
):
def
version
(
request
):
return
{
'version'
:
trans
.
VERSION
}
return
{
'version'
:
weblate
.
VERSION
}
def
title
(
request
):
def
title
(
request
):
return
{
'site_title'
:
settings
.
SITE_TITLE
}
return
{
'site_title'
:
settings
.
SITE_TITLE
}
...
...
weblate/trans/models.py
View file @
39eb8727
from
django.db
import
models
from
django.db
import
models
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.conf
import
settings
from
django.conf
import
settings
from
lang.models
import
Language
from
django.db.models
import
Sum
from
django.db.models
import
Sum
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
from
django.utils.safestring
import
mark_safe
from
django.utils.safestring
import
mark_safe
...
@@ -20,9 +19,10 @@ from translate.storage import factory
...
@@ -20,9 +19,10 @@ from translate.storage import factory
from
translate.storage
import
poheader
from
translate.storage
import
poheader
from
datetime
import
datetime
from
datetime
import
datetime
import
trans
import
weblate
import
trans.checks
from
weblate.lang.models
import
Language
from
trans.managers
import
TranslationManager
,
UnitManager
,
DictionaryManager
from
weblate.trans.checks
import
CHECKS
from
weblate.trans.managers
import
TranslationManager
,
UnitManager
,
DictionaryManager
from
util
import
is_plural
,
split_plural
,
join_plural
from
util
import
is_plural
,
split_plural
,
join_plural
logger
=
logging
.
getLogger
(
'weblate'
)
logger
=
logging
.
getLogger
(
'weblate'
)
...
@@ -746,7 +746,7 @@ class Translation(models.Model):
...
@@ -746,7 +746,7 @@ class Translation(models.Model):
plural_forms
=
self
.
language
.
get_plural_form
(),
plural_forms
=
self
.
language
.
get_plural_form
(),
language
=
self
.
language
.
code
,
language
=
self
.
language
.
code
,
PO_Revision_Date
=
po_revision_date
,
PO_Revision_Date
=
po_revision_date
,
x_generator
=
'Weblate %s'
%
trans
.
VERSION
x_generator
=
'Weblate %s'
%
weblate
.
VERSION
)
)
self
.
commit_pending
(
author
)
self
.
commit_pending
(
author
)
store
.
save
()
store
.
save
()
...
@@ -768,10 +768,10 @@ class Translation(models.Model):
...
@@ -768,10 +768,10 @@ class Translation(models.Model):
result
.
append
((
'fuzzy'
,
_
(
'Fuzzy strings (%d)'
)
%
fuzzy
))
result
.
append
((
'fuzzy'
,
_
(
'Fuzzy strings (%d)'
)
%
fuzzy
))
if
suggestions
>
0
:
if
suggestions
>
0
:
result
.
append
((
'suggestions'
,
_
(
'Strings with suggestions (%d)'
)
%
suggestions
))
result
.
append
((
'suggestions'
,
_
(
'Strings with suggestions (%d)'
)
%
suggestions
))
for
check
in
trans
.
checks
.
CHECKS
:
for
check
in
CHECKS
:
cnt
=
self
.
unit_set
.
filter_type
(
check
).
count
()
cnt
=
self
.
unit_set
.
filter_type
(
check
).
count
()
if
cnt
>
0
:
if
cnt
>
0
:
desc
=
trans
.
checks
.
CHECKS
[
check
].
description
+
(
' (%d)'
%
cnt
)
desc
=
CHECKS
[
check
].
description
+
(
' (%d)'
%
cnt
)
result
.
append
((
check
,
desc
))
result
.
append
((
check
,
desc
))
return
result
return
result
...
@@ -1047,8 +1047,8 @@ class Unit(models.Model):
...
@@ -1047,8 +1047,8 @@ class Unit(models.Model):
src
=
self
.
get_source_plurals
()
src
=
self
.
get_source_plurals
()
tgt
=
self
.
get_target_plurals
()
tgt
=
self
.
get_target_plurals
()
failing
=
[]
failing
=
[]
for
check
in
trans
.
checks
.
CHECKS
:
for
check
in
CHECKS
:
if
trans
.
checks
.
CHECKS
[
check
].
check
(
src
,
tgt
,
self
.
flags
,
self
.
translation
.
language
,
self
):
if
CHECKS
[
check
].
check
(
src
,
tgt
,
self
.
flags
,
self
.
translation
.
language
,
self
):
failing
.
append
(
check
)
failing
.
append
(
check
)
for
check
in
self
.
checks
():
for
check
in
self
.
checks
():
...
@@ -1099,7 +1099,7 @@ class Suggestion(models.Model):
...
@@ -1099,7 +1099,7 @@ class Suggestion(models.Model):
unit
.
fuzzy
=
False
unit
.
fuzzy
=
False
unit
.
save_backend
(
request
,
False
)
unit
.
save_backend
(
request
,
False
)
CHECK_CHOICES
=
[(
x
,
trans
.
checks
.
CHECKS
[
x
].
name
)
for
x
in
trans
.
checks
.
CHECKS
]
CHECK_CHOICES
=
[(
x
,
CHECKS
[
x
].
name
)
for
x
in
CHECKS
]
class
Check
(
models
.
Model
):
class
Check
(
models
.
Model
):
checksum
=
models
.
CharField
(
max_length
=
40
,
default
=
''
,
blank
=
True
,
db_index
=
True
)
checksum
=
models
.
CharField
(
max_length
=
40
,
default
=
''
,
blank
=
True
,
db_index
=
True
)
...
@@ -1121,10 +1121,10 @@ class Check(models.Model):
...
@@ -1121,10 +1121,10 @@ class Check(models.Model):
)
)
def
get_description
(
self
):
def
get_description
(
self
):
return
trans
.
checks
.
CHECKS
[
self
.
check
].
description
return
CHECKS
[
self
.
check
].
description
def
get_doc_url
(
self
):
def
get_doc_url
(
self
):
return
trans
.
checks
.
CHECKS
[
self
.
check
].
get_doc_url
()
return
CHECKS
[
self
.
check
].
get_doc_url
()
class
Dictionary
(
models
.
Model
):
class
Dictionary
(
models
.
Model
):
project
=
models
.
ForeignKey
(
Project
)
project
=
models
.
ForeignKey
(
Project
)
...
...
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