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
3614a1fb
Commit
3614a1fb
authored
Mar 28, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
2ec0e10a
5121898c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
trans/forms.py
trans/forms.py
+2
-1
trans/views.py
trans/views.py
+6
-3
No files found.
trans/forms.py
View file @
3614a1fb
...
...
@@ -105,7 +105,8 @@ class MergeForm(forms.Form):
merge
=
forms
.
IntegerField
()
class
AutoForm
(
forms
.
Form
):
overwrite
=
forms
.
BooleanField
(
label
=
_
(
'Overwrite entries'
),
required
=
False
,
initial
=
False
)
overwrite
=
forms
.
BooleanField
(
label
=
_
(
'Overwrite strings'
),
required
=
False
,
initial
=
False
)
inconsistent
=
forms
.
BooleanField
(
label
=
_
(
'Replace inconsistent'
),
required
=
False
,
initial
=
False
)
subproject
=
forms
.
ChoiceField
(
label
=
_
(
'Subproject to use'
),
required
=
False
,
initial
=
''
)
def
__init__
(
self
,
obj
,
*
args
,
**
kwargs
):
...
...
trans/views.py
View file @
3614a1fb
...
...
@@ -145,9 +145,12 @@ def auto_translation(request, project, subproject, lang):
autoform
=
AutoForm
(
obj
,
request
.
POST
)
change
=
None
if
autoform
.
is_valid
():
units
=
obj
.
unit_set
.
all
()
if
not
autoform
.
cleaned_data
[
'overwrite'
]:
units
=
units
.
filter
(
translated
=
False
)
if
autoform
.
cleaned_data
[
'inconsistent'
]:
units
=
obj
.
unit_set
.
filter_type
(
'inconsistent'
)
elif
autoform
.
cleaned_data
[
'overwrite'
]:
units
=
obj
.
unit_set
.
all
()
else
:
units
=
obj
.
unit_set
.
filter
(
translated
=
False
)
sources
=
Unit
.
objects
.
filter
(
translation__language
=
obj
.
language
,
translated
=
True
)
if
autoform
.
cleaned_data
[
'subproject'
]
==
''
:
...
...
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