Commit 2fa406e8 authored by Michal Čihař's avatar Michal Čihař

Add missing comments

parent 4fb5312e
......@@ -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
......
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment