aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display/sandbox')
-rw-r--r--ext/js/display/sandbox/structured-content-generator.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/js/display/sandbox/structured-content-generator.js b/ext/js/display/sandbox/structured-content-generator.js
index 1dfde39b..90a47158 100644
--- a/ext/js/display/sandbox/structured-content-generator.js
+++ b/ext/js/display/sandbox/structured-content-generator.js
@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {isStringPartiallyJapanese} from '../../language/ja/japanese.js';
+import {getLanguageFromText} from '../../language/text-utilities.js';
export class StructuredContentGenerator {
/**
@@ -163,8 +163,11 @@ export class StructuredContentGenerator {
if (typeof content === 'string') {
if (content.length > 0) {
container.appendChild(this._createTextNode(content));
- if (language === null && isStringPartiallyJapanese(content)) {
- container.lang = 'ja';
+ if (language === null) {
+ const language2 = getLanguageFromText(content);
+ if (language2 !== null) {
+ container.lang = language2;
+ }
}
}
return;