aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/sandbox/structured-content-generator.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-01-28 07:22:47 -0500
committerGitHub <noreply@github.com>2024-01-28 12:22:47 +0000
commitacc013a1a8051d34322f0f5f91d7bdecc0a18843 (patch)
tree601344b2f047f395548ddfb16a83319af10464f9 /ext/js/display/sandbox/structured-content-generator.js
parenta51f1ab2dc675a49bfeeb08cc24b97eb8d888e4a (diff)
JapaneseUtil refactor (#555)
* Copy functions from JapaneseUtil * Remove JapaneseUtil * Update usages of JapaneseUtil functions
Diffstat (limited to 'ext/js/display/sandbox/structured-content-generator.js')
-rw-r--r--ext/js/display/sandbox/structured-content-generator.js9
1 files changed, 4 insertions, 5 deletions
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 <https://www.gnu.org/licenses/>.
*/
+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';
}
}