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
bdcb241b
Commit
bdcb241b
authored
Feb 20, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better name for dictionary merge
Merging is more obvious naming than conflict.
parent
8b80c5d4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
weblate/trans/forms.py
weblate/trans/forms.py
+2
-3
weblate/trans/managers.py
weblate/trans/managers.py
+3
-3
weblate/trans/tests/test_dictionary.py
weblate/trans/tests/test_dictionary.py
+2
-2
No files found.
weblate/trans/forms.py
View file @
bdcb241b
...
...
@@ -295,9 +295,8 @@ class DictUploadForm(forms.Form):
file
=
forms
.
FileField
(
label
=
_
(
'File'
)
)
conflict
=
forms
.
ChoiceField
(
label
=
_
(
'Conflict handling'
),
help_text
=
_
(
'Imported word is already existing in the glossary'
),
method
=
forms
.
ChoiceField
(
label
=
_
(
'Merge method'
),
choices
=
(
(
''
,
_
(
'Keep current'
)),
(
'overwrite'
,
_
(
'Overwrite existing'
)),
...
...
weblate/trans/managers.py
View file @
bdcb241b
...
...
@@ -443,7 +443,7 @@ class UnitManager(models.Manager):
class
DictionaryManager
(
models
.
Manager
):
def
upload
(
self
,
project
,
language
,
fileobj
,
conflict
):
def
upload
(
self
,
project
,
language
,
fileobj
,
method
):
'''
Handles dictionary update.
'''
...
...
@@ -474,14 +474,14 @@ class DictionaryManager(models.Manager):
# Same as current -> ignore
if
unit
.
target
==
word
.
target
:
continue
if
conflict
==
'add'
:
if
method
==
'add'
:
# Add word
word
=
self
.
create
(
project
=
project
,
language
=
language
,
source
=
unit
.
source
)
elif
conflict
!=
'overwrite'
:
elif
method
!=
'overwrite'
:
# No overwriting or adding
continue
...
...
weblate/trans/tests/test_dictionary.py
View file @
bdcb241b
...
...
@@ -85,7 +85,7 @@ class DictionaryTest(ViewTestCase):
word
.
save
()
# Import file again with orverwriting
response
=
self
.
import_tbx
(
conflict
=
'overwrite'
)
response
=
self
.
import_tbx
(
method
=
'overwrite'
)
# Check number of imported objects
self
.
assertEquals
(
Dictionary
.
objects
.
count
(),
164
)
...
...
@@ -100,7 +100,7 @@ class DictionaryTest(ViewTestCase):
word
.
save
()
# Import file again with adding
response
=
self
.
import_tbx
(
conflict
=
'add'
)
response
=
self
.
import_tbx
(
method
=
'add'
)
# Check number of imported objects
self
.
assertEquals
(
Dictionary
.
objects
.
count
(),
165
)
...
...
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