Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add model fields to represent translations for form fields #7457

Merged

Conversation

siddarth2824
Copy link
Contributor

@siddarth2824 siddarth2824 commented Jun 28, 2024

Context

  • Add fields in the model layer to represent the translations for the form fields and which languages are supported for the form.
  • This PR will be the first PR to introduce the additional model fields to support for the multi translation feature.

Changes

  • Added new type called TranslationMapping which represents the translations for the specific language
  • Added titleTranslations and descriptionTranslations forbaseField type
  • Added paragraphTranslations for startPage type
  • Added fieldOptionsTranslations for CheckboxFieldSchema, RadioFieldSchema and DropdownFieldSchema

@siddarth2824 siddarth2824 marked this pull request as ready for review July 1, 2024 15:43
@@ -60,12 +73,24 @@ export enum FormAuthType {
SGID_MyInfo = 'SGID_MyInfo',
}

export enum Language {
ENGLISH = 'English',
Copy link
Contributor

@KenLSM KenLSM Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend to use unicode locales for the values since we might be supporting localization for other countries.

ENGLISH = 'en-SG',
CHINESE = 'zh-SG',
  MALAY = 'ms-SG',
  TAMIL = 'ta-SG',

^ opting to stick to the simpler "ISO 639 two-letter language codes and ISO 3166 two-letter country codes".

@siddarth2824 siddarth2824 requested a review from KenLSM July 3, 2024 06:04
Copy link
Contributor

@KenLSM KenLSM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@siddarth2824 siddarth2824 merged commit 0ab3e87 into feat/multi-lang-feature Jul 4, 2024
13 of 15 checks passed
@siddarth2824 siddarth2824 deleted the feat/multi-lang/add-backend-types branch July 4, 2024 02:39
siddarth2824 added a commit that referenced this pull request Aug 8, 2024
* feat: add fields in model to represent translations for form fields

* feat: add shared types to represent form field translations

* fix: use unicode locales
siddarth2824 added a commit that referenced this pull request Sep 22, 2024
* feat: add fields in model to represent translations for form fields

* feat: add shared types to represent form field translations

* fix: use unicode locales
siddarth2824 added a commit that referenced this pull request Oct 15, 2024
* feat: add fields in model to represent translations for form fields

* feat: add shared types to represent form field translations

* fix: use unicode locales
siddarth2824 added a commit that referenced this pull request Oct 15, 2024
* feat: add fields in model to represent translations for form fields

* feat: add shared types to represent form field translations

* fix: use unicode locales
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants