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

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