Skip to content

Commit

Permalink
Improve translation
Browse files Browse the repository at this point in the history
  • Loading branch information
chiragchhatrala committed Nov 29, 2024
1 parent d7a2893 commit cec2aa1
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 9 deletions.
13 changes: 6 additions & 7 deletions client/components/open/forms/OpenCompleteForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<div v-if="isPublicFormPage && form.is_password_protected">
<p class="form-description mb-4 text-gray-700 dark:text-gray-300 px-2">
This form is protected by a password.
{{ $t('forms.password_protected') }}
</p>
<div class="form-group flex flex-wrap w-full">
<div class="relative mb-3 w-full px-2">
Expand All @@ -47,7 +47,7 @@
class="my-4"
@click="passwordEntered"
>
Submit
{{ $t('forms.submit') }}
</open-form-button>
</div>
</div>
Expand Down Expand Up @@ -139,7 +139,7 @@
class="text-gray-400 hover:text-gray-500 dark:text-gray-600 dark:hover:text-gray-500 cursor-pointer hover:underline text-xs"
target="_blank"
>
Powered by <span class="font-semibold">OpnForm</span>
{{ $t('forms.powered_by') }} <span class="font-semibold">{{ $t('app.name') }}</span>
</a>
</p>
</div>
Expand Down Expand Up @@ -186,7 +186,7 @@
href="https://opnform.com/?utm_source=form&utm_content=create_form_free"
class="text-nt-blue hover:underline"
>
Create your form for free with OpnForm
{{ $t('forms.create_form_free') }}
</a>
</p>
</div>
Expand All @@ -202,7 +202,6 @@
<script>
import OpenForm from './OpenForm.vue'
import OpenFormButton from './OpenFormButton.vue'
import FormTimer from './FormTimer.vue'
import FormCleanings from '../../pages/forms/show/FormCleanings.vue'
import VTransition from '~/components/global/transitions/VTransition.vue'
import {pendingSubmission} from "~/composables/forms/pendingSubmission.js"
Expand All @@ -211,7 +210,7 @@ import ThemeBuilder from "~/lib/forms/themes/ThemeBuilder.js"
import FirstSubmissionModal from '~/components/open/forms/components/FirstSubmissionModal.vue'
export default {
components: { VTransition, OpenFormButton, OpenForm, FormCleanings, FormTimer, FirstSubmissionModal },
components: { VTransition, OpenFormButton, OpenForm, FormCleanings, FirstSubmissionModal },
props: {
form: { type: Object, required: true },
Expand Down Expand Up @@ -360,7 +359,7 @@ export default {
if (this.passwordForm.password !== '' && this.passwordForm.password !== null) {
this.$emit('password-entered', this.passwordForm.password)
} else {
this.addPasswordError('The Password field is required.')
this.addPasswordError(this.$t('forms.password_required'))
}
},
addPasswordError (msg) {
Expand Down
2 changes: 1 addition & 1 deletion client/components/open/forms/OpenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
{{ currentFieldsPageBreak.next_btn_text }}
</open-form-button>
<div v-if="!currentFieldsPageBreak && !isLastPage">
Something is wrong with this form structure. If you're the form owner please contact us.
{{ $t('forms.wrong_form_structure') }}
</div>
</div>
</form>
Expand Down
10 changes: 10 additions & 0 deletions client/i18n/lang/ar.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"app": {
"name": "أوبنفورم"
},
"forms": {
"powered_by": "مشغل بواسطة",
"password_protected": "هذا النموذج محمي بكلمة مرور.",
"invalid_password": "كلمة مرور غير صالحة.",
"password_required": "كلمة مرور مطلوبة.",
"create_form_free": "أنشأ نموذجك مجانًا باستخدام أوبنفورم",
"submit": "إرسال",
"wrong_form_structure": "هناك خطأ في بنية هذا النموذج. إذا كنت مالك النموذج، يرجى الاتصال بنا.",
"select": {
"search": "بحث",
"searchOrTypeToCreateNew": "بحث أو اكتب شيءً لإضافة خيار",
Expand Down
10 changes: 10 additions & 0 deletions client/i18n/lang/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"app": {
"name": "OpnForm"
},
"forms": {
"powered_by": "Powered by",
"password_protected": "This form is protected by a password.",
"invalid_password": "Invalid password.",
"password_required": "Password is required.",
"create_form_free": "Create your form for free with OpnForm",
"submit": "Submit",
"wrong_form_structure": "Something is wrong with this form structure. If you're the form owner please contact us.",
"select": {
"search": "Search",
"searchOrTypeToCreateNew": "Search or type to create new",
Expand Down
10 changes: 10 additions & 0 deletions client/i18n/lang/es.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"app": {
"name": "OpnForm"
},
"forms": {
"powered_by": "Desarrollado por",
"password_protected": "Este formulario está protegido por una contraseña.",
"invalid_password": "Contraseña inválida.",
"password_required": "Se requiere una contraseña.",
"create_form_free": "Crea tu formulario gratis con OpnForm",
"submit": "Enviar",
"wrong_form_structure": "Algo está mal con la estructura de este formulario. Si eres el propietario del formulario, por favor contacta con nosotros.",
"select": {
"search": "Buscar",
"searchOrTypeToCreateNew": "Buscar o escribe algo para crear una nueva opción",
Expand Down
10 changes: 10 additions & 0 deletions client/i18n/lang/fr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"app": {
"name": "OpnForm"
},
"forms": {
"powered_by": "Powered by",
"password_protected": "Ce formulaire est protégé par un mot de passe.",
"invalid_password": "Mot de passe invalide.",
"password_required": "Le mot de passe est requis.",
"create_form_free": "Créez votre formulaire gratuitement avec OpnForm",
"submit": "Envoyer",
"wrong_form_structure": "Quelque chose ne va pas avec la structure de ce formulaire. Si vous êtes le propriétaire du formulaire, veuillez nous contacter.",
"select": {
"search": "Rechercher",
"searchOrTypeToCreateNew": "Rechercher ou écrivez quelque chose pour créer une nouvelle option",
Expand Down
10 changes: 10 additions & 0 deletions client/i18n/lang/hi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"app": {
"name": "ऑपनफॉर्म"
},
"forms": {
"powered_by": "ऑपनफॉर्म के साथ",
"password_protected": "यह फ़ॉर्म पासवर्ड से सुरक्षित है।",
"invalid_password": "अमान्य पासवर्ड।",
"password_required": "पासवर्ड आवश्यक है।",
"create_form_free": "अपनी फ़ॉर्म फ्री में ऑपनफॉर्म के साथ बनाएं",
"submit": "जमा करें",
"wrong_form_structure": "यह फ़ॉर्म संरचना में कुछ गलत है। यदि आप फ़ॉर्म का मालिक हैं, तो कृपया हमसे संपर्क करें।",
"select": {
"search": "खोजें",
"searchOrTypeToCreateNew": "खोजें या कुछ भी टाइप करें जो विकल्प जोड़ने के लिए",
Expand Down
10 changes: 10 additions & 0 deletions client/i18n/lang/ja.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"app": {
"name": "OpnForm"
},
"forms": {
"powered_by": "Powered by",
"password_protected": "このフォームはパスワードで保護されています。",
"invalid_password": "無効なパスワード。",
"password_required": "パスワードが必要です。",
"create_form_free": "無料でOpnFormでフォームを作成",
"submit": "送信",
"wrong_form_structure": "このフォームの構造に問題があります。フォームの所有者である場合は、お問い合わせください。",
"select": {
"search": "検索",
"searchOrTypeToCreateNew": "検索または何かを入力して新しいオプションを作成",
Expand Down
10 changes: 10 additions & 0 deletions client/i18n/lang/pt.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"app": {
"name": "OpnForm"
},
"forms": {
"powered_by": "Powered by",
"password_protected": "Este formulário está protegido por uma senha.",
"invalid_password": "Senha inválida.",
"password_required": "A senha é necessária.",
"create_form_free": "Crie seu formulário gratuitamente com OpnForm",
"submit": "Enviar",
"wrong_form_structure": "Algo está errado com a estrutura deste formulário. Se você é o proprietário do formulário, por favor entre em contato conosco.",
"select": {
"search": "Buscar",
"searchOrTypeToCreateNew": "Buscar ou escreva algo para criar uma nova opção",
Expand Down
10 changes: 10 additions & 0 deletions client/i18n/lang/zh.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"app": {
"name": "OpnForm"
},
"forms": {
"powered_by": "Powered by",
"password_protected": "此表单受密码保护。",
"invalid_password": "无效密码。",
"password_required": "密码是必需的。",
"create_form_free": "免费使用OpnForm创建表单",
"submit": "提交",
"wrong_form_structure": "此表单的结构有问题。如果您是表单所有者,请与我们联系。",
"select": {
"search": "搜索",
"searchOrTypeToCreateNew": "搜索或输入以创建新选项",
Expand Down
3 changes: 2 additions & 1 deletion client/pages/forms/[slug]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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'))
}
})
})
Expand Down

0 comments on commit cec2aa1

Please sign in to comment.