Open chiragchhatrala opened 1 week ago
The pull request introduces several modifications across multiple files to enhance localization and validation features in the application. Key changes include the addition of a language
field and related validation rules in form requests, updates to resource classes to include language data, and the implementation of internationalization support in various components. New localization files for multiple languages have been created, and existing components have been updated to utilize these localization features. Additionally, a migration has been added to accommodate the new language
column in the database.
File Path | Change Summary |
---|---|
api/app/Http/Requests/AnswerFormRequest.php |
Updated prepareForValidation to set locale and process data. |
api/app/Http/Requests/UserFormRequest.php |
Added required validation rule for language field. |
api/app/Http/Resources/FormResource.php |
Updated getProtectedForm to include language field. |
api/app/Models/Forms/Form.php |
Added constant LANGUAGES and updated fillable to include language . |
api/config/app.php |
Added multiple locale entries to locales array. |
api/database/factories/FormFactory.php |
Updated definition() to include default language set to 'en'. |
api/database/migrations/2024_11_08_133330_add_language_to_forms_table.php |
Created migration to add language column to forms table. |
api/resources/lang/fr/validation.php |
Created French validation messages file. |
api/resources/lang/ar/validation.php |
Created Arabic validation messages file. |
api/resources/lang/hi/validation.php |
Created Hindi validation messages file. |
api/resources/lang/ja/validation.php |
Created Japanese validation messages file. |
api/resources/lang/zh/validation.php |
Created Chinese validation messages file. |
client/components/forms/FileInput.vue |
Updated text to use localization for file upload prompts. |
client/components/forms/SignatureInput.vue |
Updated text to use localization for signature input prompts. |
client/components/forms/components/CameraUpload.vue |
Updated text to use localization for camera upload prompts. |
client/components/open/forms/OpenCompleteForm.vue |
Added setLocale method and improved form submission handling. |
client/components/open/forms/components/form-components/FormCustomization.vue |
Added <select-input> component for language selection. |
client/composables/forms/initForm.js |
Added language property to the initForm return object. |
client/i18n/lang/en.json |
Created English localization strings for various components. |
client/i18n/lang/fr.json |
Created French localization strings for various components. |
client/i18n/lang/ar.json |
Created Arabic localization strings for various components. |
client/i18n/lang/hi.json |
Created Hindi localization strings for various components. |
client/i18n/lang/ja.json |
Created Japanese localization strings for various components. |
client/i18n/lang/zh.json |
Created Chinese localization strings for various components. |
client/nuxt.config.ts |
Added @nuxtjs/i18n module and configured internationalization settings. |
client/package.json |
Added @nuxtjs/i18n to devDependencies . |
client/pages/forms/[slug]/index.vue |
Added htmlAttrs to set the lang attribute dynamically based on form language. |
OpenFormField.vue
include the addition of a locale
property, which relates to the localization enhancements made in the AnswerFormRequest
class's prepareForValidation
method, where the application locale is set based on the form's language.🐰 "In fields of code where changes bloom,
New languages sprout, dispelling gloom.
With forms that speak in tongues so bright,
We hop along, in joy and delight!
Validation's strong, our paths align,
A world of words, both yours and mine!" 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
Release Notes
New Features
Improvements
Bug Fixes
These updates enhance user experience by providing localized content and improving form interactions.