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:
Chirag Chhatrala
2024-12-04 23:02:14 +05:30
committed by GitHub
parent c927a235f8
commit daca69267b
36 changed files with 1589 additions and 32 deletions

View File

@@ -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