summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/database.js2
-rw-r--r--ext/bg/js/translator.js2
-rw-r--r--ext/bg/js/util.js4
3 files changed, 6 insertions, 2 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 400ebd6a..69a3bbdd 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -35,7 +35,7 @@ class Database {
}
prepare() {
- if (!this.db) {
+ if (this.db) {
return Promise.reject('database already initialized');
}
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 8d65a0cd..f1858247 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -53,7 +53,7 @@ class Translator {
}
return this.findTermsDeinflected(text, titles, cache).then(deinfLiteral => {
- const textHiragana = wanakana._katakanaToHiragana(text);
+ const textHiragana = jpKatakanaToHiragana(text);
if (text === textHiragana) {
return deinfLiteral;
} else {
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index cdd5ec31..b39b4b2f 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -43,6 +43,10 @@ function jpIsKana(c) {
return wanakana.isKana(c);
}
+function jpKatakanaToHiragana(text) {
+ return wanakana._katakanaToHiragana(text);
+}
+
/*
* Commands