Commit 8a9a38a0 authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents 479e8e4a 1679609e
......@@ -55,7 +55,10 @@ function submitForm(evt) {
$form = $('.translation-form');
}
if ($form.length > 0) {
$form.find('input[type="submit"]')[0].click();
var submits = $form.find('input[type="submit"]');
if (submits.length > 0) {
submits[0].click();
}
}
return false;
}
......
......@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import sys
from django.db import models
from django.db.models import Q
from django.utils.encoding import force_unicode
......@@ -25,6 +26,7 @@ from weblate.lang.models import Language
from weblate.trans.formats import AutoFormat, StringIOMode
from weblate.trans.models.project import Project
from translate.storage.csvl10n import csvfile
from weblate.trans.util import report_error
from django.core.urlresolvers import reverse
from whoosh.analysis import (
LanguageAnalyzer, StandardAnalyzer, StemmingAnalyzer, NgramAnalyzer
......@@ -151,9 +153,13 @@ class DictionaryManager(models.Manager):
# Extract words from all plurals and from context
for text in unit.get_source_plurals() + [unit.context]:
for analyzer in analyzers:
words = words.union(
[token.text for token in analyzer(force_unicode(text))]
)
# Some Whoosh analyzers break on unicode
try:
words.update(
[token.text for token in analyzer(force_unicode(text))]
)
except UnicodeDecodeError as error:
report_error(error, sys.exc_info())
# Grab all words in the dictionary
dictionary = self.filter(
......
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