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
026782b5
Commit
026782b5
authored
Sep 18, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap long lines
parent
c55e5415
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
trans/models/dictionary.py
trans/models/dictionary.py
+10
-3
trans/views/changes.py
trans/views/changes.py
+12
-3
No files found.
trans/models/dictionary.py
View file @
026782b5
...
...
@@ -34,13 +34,17 @@ class DictionaryManager(models.Manager):
# Load file using translate-toolkit
store
=
AutoFormat
.
load
(
fileobj
)
ret
,
skipped
=
self
.
import_store
(
request
,
project
,
language
,
store
,
method
)
ret
,
skipped
=
self
.
import_store
(
request
,
project
,
language
,
store
,
method
)
if
ret
==
0
and
skipped
>
0
and
isinstance
(
store
,
csvfile
):
# Retry with different CSV scheme
fileobj
.
seek
(
0
)
store
=
csvfile
(
fileobj
,
(
'source'
,
'target'
))
ret
,
skipped
=
self
.
import_store
(
request
,
project
,
language
,
store
,
method
)
ret
,
skipped
=
self
.
import_store
(
request
,
project
,
language
,
store
,
method
)
return
ret
...
...
@@ -139,7 +143,10 @@ class Dictionary(models.Model):
return
'%s?id=%d'
%
(
reverse
(
'edit_dictionary'
,
kwargs
=
{
'project'
:
self
.
project
.
slug
,
'lang'
:
self
.
language
.
code
}
kwargs
=
{
'project'
:
self
.
project
.
slug
,
'lang'
:
self
.
language
.
code
}
),
self
.
pk
)
...
...
trans/views/changes.py
View file @
026782b5
...
...
@@ -93,7 +93,10 @@ class ChangesView(ListView):
self
.
request
.
GET
.
get
(
'lang'
,
None
),
)
except
Http404
:
messages
.
error
(
self
.
request
,
_
(
'Failed to find matching project!'
))
messages
.
error
(
self
.
request
,
_
(
'Failed to find matching project!'
)
)
# Filtering by language
if
self
.
translation
is
None
and
'lang'
in
self
.
request
.
GET
:
...
...
@@ -102,7 +105,10 @@ class ChangesView(ListView):
code
=
self
.
request
.
GET
[
'lang'
]
)
except
Language
.
DoesNotExist
:
messages
.
error
(
self
.
request
,
_
(
'Failed to find matching language!'
))
messages
.
error
(
self
.
request
,
_
(
'Failed to find matching language!'
)
)
# Filtering by user
if
'user'
in
self
.
request
.
GET
:
...
...
@@ -111,7 +117,10 @@ class ChangesView(ListView):
username
=
self
.
request
.
GET
[
'user'
]
)
except
User
.
DoesNotExist
:
messages
.
error
(
self
.
request
,
_
(
'Failed to find matching user!'
))
messages
.
error
(
self
.
request
,
_
(
'Failed to find matching user!'
)
)
# Glossary entries
self
.
glossary
=
'glossary'
in
self
.
request
.
GET
...
...
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