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:
@@ -74,6 +74,14 @@
|
||||
label="Uppercase Input Labels"
|
||||
/>
|
||||
|
||||
<select-input
|
||||
name="language"
|
||||
class="mt-4"
|
||||
:options="availableLocales"
|
||||
:form="form"
|
||||
label="Form Language"
|
||||
/>
|
||||
|
||||
<EditorSectionHeader
|
||||
icon="heroicons:rectangle-stack-16-solid"
|
||||
title="Layout & Sizing"
|
||||
@@ -215,6 +223,7 @@ const form = storeToRefs(workingFormStore).content
|
||||
const isMounted = ref(false)
|
||||
const confetti = useConfetti()
|
||||
const showGoogleFontPicker = ref(false)
|
||||
const { $i18n } = useNuxtApp()
|
||||
|
||||
const user = computed(() => authStore.user)
|
||||
const workspace = computed(() => workspacesStore.getCurrent)
|
||||
@@ -225,6 +234,10 @@ const isPro = computed(() => {
|
||||
return workspace.value.is_pro
|
||||
})
|
||||
|
||||
const availableLocales = computed(() => {
|
||||
return $i18n.locales?.value.map(locale => ({ name: locale.name, value: locale.code })) ?? []
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
isMounted.value = true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user