Form Translation (#616)
* Form Translation * Support for other languages * Support locale for datepicker * Apply translation on select input * Apply translation on select input * Improve translation --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -93,6 +93,7 @@ const formLoading = computed(() => formsStore.loading)
|
||||
const recordLoading = computed(() => recordsStore.loading)
|
||||
const slug = useRoute().params.slug
|
||||
const form = computed(() => formsStore.getByKey(slug))
|
||||
const $t = useI18n()
|
||||
|
||||
const openCompleteForm = ref(null)
|
||||
|
||||
@@ -106,7 +107,7 @@ const passwordEntered = function (password) {
|
||||
nextTick(() => {
|
||||
loadForm().then(() => {
|
||||
if (form.value?.is_password_protected) {
|
||||
openCompleteForm.value.addPasswordError('Invalid password.')
|
||||
openCompleteForm.value.addPasswordError($t('forms.invalid_password'))
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -235,7 +236,11 @@ useOpnSeoMeta({
|
||||
return (form.value && form.value?.can_be_indexed) ? null : 'noindex, nofollow'
|
||||
}
|
||||
})
|
||||
|
||||
useHead({
|
||||
htmlAttrs: {
|
||||
lang: (form.value?.language) ? form.value.language : 'en'
|
||||
},
|
||||
titleTemplate: (titleChunk) => {
|
||||
if (pageMeta.value.page_title) {
|
||||
// Disable template if custom SEO title
|
||||
|
||||
Reference in New Issue
Block a user