From acc013a1a8051d34322f0f5f91d7bdecc0a18843 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 28 Jan 2024 07:22:47 -0500 Subject: JapaneseUtil refactor (#555) * Copy functions from JapaneseUtil * Remove JapaneseUtil * Update usages of JapaneseUtil functions --- ext/js/display/sandbox/structured-content-generator.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ext/js/display/sandbox/structured-content-generator.js') diff --git a/ext/js/display/sandbox/structured-content-generator.js b/ext/js/display/sandbox/structured-content-generator.js index ee86a7f4..60bf0ee5 100644 --- a/ext/js/display/sandbox/structured-content-generator.js +++ b/ext/js/display/sandbox/structured-content-generator.js @@ -16,17 +16,16 @@ * along with this program. If not, see . */ +import {isStringPartiallyJapanese} from '../../language/japanese.js'; + export class StructuredContentGenerator { /** * @param {import('../../display/display-content-manager.js').DisplayContentManager|import('../../templates/sandbox/anki-template-renderer-content-manager.js').AnkiTemplateRendererContentManager} contentManager - * @param {import('../../language/sandbox/japanese-util.js').JapaneseUtil} japaneseUtil * @param {Document} document */ - constructor(contentManager, japaneseUtil, document) { + constructor(contentManager, document) { /** @type {import('../../display/display-content-manager.js').DisplayContentManager|import('../../templates/sandbox/anki-template-renderer-content-manager.js').AnkiTemplateRendererContentManager} */ this._contentManager = contentManager; - /** @type {import('../../language/sandbox/japanese-util.js').JapaneseUtil} */ - this._japaneseUtil = japaneseUtil; /** @type {Document} */ this._document = document; } @@ -164,7 +163,7 @@ export class StructuredContentGenerator { if (typeof content === 'string') { if (content.length > 0) { container.appendChild(this._createTextNode(content)); - if (language === null && this._japaneseUtil.isStringPartiallyJapanese(content)) { + if (language === null && isStringPartiallyJapanese(content)) { container.lang = 'ja'; } } -- cgit v1.2.3