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
2fa406e8
Commit
2fa406e8
authored
Jul 27, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing comments
parent
4fb5312e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
weblate/trans/managers.py
weblate/trans/managers.py
+5
-1
weblate/trans/views.py
weblate/trans/views.py
+9
-0
No files found.
weblate/trans/managers.py
View file @
2fa406e8
...
...
@@ -11,6 +11,7 @@ from util import join_plural, msg_checksum
from
weblate.trans.search
import
FULLTEXT_INDEX
,
SOURCE_SCHEMA
,
TARGET_SCHEMA
# Set of ignored words
IGNORE_WORDS
=
set
([
'a'
,
'an'
,
...
...
@@ -49,7 +50,7 @@ IGNORE_WORDS = set([
'with'
,
])
#
List of
#
Set of words to ignore in similar lookup
IGNORE_SIMILAR
=
set
([
'also'
,
'class'
,
...
...
@@ -307,6 +308,9 @@ class UnitManager(models.Manager):
class
DictionaryManager
(
models
.
Manager
):
def
upload
(
self
,
project
,
language
,
fileobj
,
overwrite
):
'''
Handles dictionary update.
'''
from
weblate.trans.models
import
ttkit
ret
=
0
...
...
weblate/trans/views.py
View file @
2fa406e8
...
...
@@ -998,6 +998,9 @@ def get_string(request, checksum):
return
HttpResponse
(
units
[
0
].
get_source_plurals
()[
0
])
def
get_similar
(
request
,
unit_id
):
'''
AJAX handler for getting similar strings.
'''
unit
=
get_object_or_404
(
Unit
,
pk
=
int
(
unit_id
))
similar
=
Unit
.
objects
.
similar
(
unit
)
...
...
@@ -1018,6 +1021,9 @@ def get_similar(request, unit_id):
}))
def
get_other
(
request
,
unit_id
):
'''
AJAX handler for same strings in other subprojects.
'''
unit
=
get_object_or_404
(
Unit
,
pk
=
int
(
unit_id
))
other
=
Unit
.
objects
.
same
(
unit
)
...
...
@@ -1032,6 +1038,9 @@ def get_other(request, unit_id):
}))
def
get_dictionary
(
request
,
unit_id
):
'''
Lists words from dictionary for current translation.
'''
unit
=
get_object_or_404
(
Unit
,
pk
=
int
(
unit_id
))
# split to words
ana
=
StandardAnalyzer
()
...
...
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