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
2ec0e10a
Commit
2ec0e10a
authored
Mar 28, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
6b5f6cf7
90e996a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
trans/views.py
trans/views.py
+4
-0
No files found.
trans/views.py
View file @
2ec0e10a
...
@@ -141,7 +141,9 @@ def show_subproject(request, project, subproject):
...
@@ -141,7 +141,9 @@ def show_subproject(request, project, subproject):
@
permission_required
(
'trans.automatic_translation'
)
@
permission_required
(
'trans.automatic_translation'
)
def
auto_translation
(
request
,
project
,
subproject
,
lang
):
def
auto_translation
(
request
,
project
,
subproject
,
lang
):
obj
=
get_object_or_404
(
Translation
,
language__code
=
lang
,
subproject__slug
=
subproject
,
subproject__project__slug
=
project
)
obj
=
get_object_or_404
(
Translation
,
language__code
=
lang
,
subproject__slug
=
subproject
,
subproject__project__slug
=
project
)
obj
.
commit_pending
()
autoform
=
AutoForm
(
obj
,
request
.
POST
)
autoform
=
AutoForm
(
obj
,
request
.
POST
)
change
=
None
if
autoform
.
is_valid
():
if
autoform
.
is_valid
():
units
=
obj
.
unit_set
.
all
()
units
=
obj
.
unit_set
.
all
()
if
not
autoform
.
cleaned_data
[
'overwrite'
]:
if
not
autoform
.
cleaned_data
[
'overwrite'
]:
...
@@ -161,6 +163,8 @@ def auto_translation(request, project, subproject, lang):
...
@@ -161,6 +163,8 @@ def auto_translation(request, project, subproject, lang):
update
=
update
[
0
]
update
=
update
[
0
]
unit
.
fuzzy
=
update
.
fuzzy
unit
.
fuzzy
=
update
.
fuzzy
unit
.
target
=
update
.
target
unit
.
target
=
update
.
target
if
change
is
None
:
change
=
Change
.
objects
.
create
(
unit
=
self
,
user
=
request
.
user
)
unit
.
save_backend
(
request
,
False
,
False
)
unit
.
save_backend
(
request
,
False
,
False
)
messages
.
add_message
(
request
,
messages
.
INFO
,
_
(
'Automatic translation completed.'
))
messages
.
add_message
(
request
,
messages
.
INFO
,
_
(
'Automatic translation completed.'
))
else
:
else
:
...
...
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