aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/translator.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/language/translator.js')
-rw-r--r--ext/js/language/translator.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js
index aa1b71dd..e33ea4d4 100644
--- a/ext/js/language/translator.js
+++ b/ext/js/language/translator.js
@@ -125,6 +125,9 @@ export class Translator {
* @returns {Promise<import('dictionary').KanjiDictionaryEntry[]>} An array of definitions. See the _createKanjiDefinition() function for structure details.
*/
async findKanji(text, options) {
+ if (options.removeNonJapaneseCharacters) {
+ text = this._getJapaneseOnlyText(text);
+ }
const {enabledDictionaryMap} = options;
const kanjiUnique = new Set();
for (const c of text) {