Internal: Fix translate_html issues - refs BT#21540

pull/5409/head
christianbeeznst 7 months ago
parent 0986bbfd4f
commit be55c477a8
  1. 1
      assets/css/scorm.scss
  2. 14
      assets/js/translatehtml.js
  3. 2
      assets/vue/views/course/CourseHome.vue

@ -444,6 +444,7 @@ body {
.icon-toolbar .fa:hover,
.icon-toolbar .mdi:hover {
color: #666666;
}
.expand .fa,

@ -1,20 +1,13 @@
/* For licensing terms, see /license.txt */
import { usePlatformConfig } from "../vue/store/platformConfig"
function normalizeLocale(locale) {
return locale.split('_')[0]
}
export default async function translateHtml() {
try {
const platformConfigStore = usePlatformConfig()
await platformConfigStore.initialize()
export default function translateHtml() {
if (
window.user &&
window.user.locale &&
"true" === platformConfigStore.getSetting("editor.translate_html")
window.user.locale
) {
var isoCode = normalizeLocale(window.user.locale)
const translateElement = document.querySelector(".mce-translatehtml")
@ -50,7 +43,4 @@ export default async function translateHtml() {
}
}
}
} catch (error) {
console.error("Error in translateHtml:", error)
}
}

@ -382,9 +382,11 @@ const isAllowedToEdit = ref(false)
onMounted(async () => {
isAllowedToEdit.value = await checkIsAllowedToEdit()
if ("true" === platformConfigStore.getSetting("editor.translate_html")) {
setTimeout(() => {
translateHtml()
}, 1000)
}
})
const onStudentViewChanged = async () => {

Loading…
Cancel
Save