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

ESC 483 - Add localized 'Yes' and 'No' translations for checkbox fields #710

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

chiragchhatrala
Copy link
Collaborator

@chiragchhatrala chiragchhatrala commented Feb 24, 2025

Summary by CodeRabbit

  • New Features
    • Checkbox field responses now display localized “Yes” and “No” messages, ensuring a contextually appropriate interface.
    • Expanded language support by adding affirmative and negative translations across various languages, enhancing the user experience globally.

Copy link
Contributor

coderabbitai bot commented Feb 24, 2025

Walkthrough

This pull request updates the checkbox value formatting in the FormSubmissionFormatter to use localized strings via the trans function. Instead of hardcoding "Yes" and "No", the formatter now retrieves trans('validation.yes') and trans('validation.no'). Additionally, new translation entries for these keys have been added across multiple language validation files, broadening localization support throughout the application. No modifications were made to public interfaces.

Changes

Files Change Summaries
api/app/Service/Forms/FormSubmissionFormatter.php Updated checkbox field processing to retrieve localized values via trans('validation.yes') and trans('validation.no') instead of hard-coded strings.
api/resources/lang/.../validation.php Added new entries for 'yes' and 'no' in various languages (ar, bn, ca, cs, de, en, es, eu, fr, gl, hi, ja, jv, ko, mr, pa, pl, pt-BR, pt, ru, sk, sv, ta, te, tr, ur, vi, zh-CN, zh) to support localization.

Sequence Diagram(s)

sequenceDiagram
    participant F as FormSubmissionFormatter
    participant T as Translation Service
    participant L as Localization Files

    F->>T: Call trans('validation.yes') / trans('validation.no')
    T->>L: Retrieve corresponding translation
    L-->>T: Return localized string
    T-->>F: Return localized value
    F->>F: Format checkbox field with localized value
Loading

Possibly related PRs

  • Form Translation #616: Focuses on localization of checkbox values similar to the current changes, linking UI representation to language entries.
  • Refactor form components #659: Involves modifications to localization files for adding translations, directly related to the language support updates.

Suggested reviewers

  • JhumanJ

Poem

I'm a rabbit in the code garden,
Hopping through lines in a language laden glen,
Checkbox values now sing "Oui" and "Sí",
With translations that set our forms free,
Joyful hops in every key—code magic again! 🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c58f2c and 366d4eb.

📒 Files selected for processing (30)
  • api/app/Service/Forms/FormSubmissionFormatter.php (1 hunks)
  • api/resources/lang/ar/validation.php (1 hunks)
  • api/resources/lang/bn/validation.php (1 hunks)
  • api/resources/lang/ca/validation.php (1 hunks)
  • api/resources/lang/cs/validation.php (1 hunks)
  • api/resources/lang/de/validation.php (1 hunks)
  • api/resources/lang/en/validation.php (1 hunks)
  • api/resources/lang/es/validation.php (1 hunks)
  • api/resources/lang/eu/validation.php (1 hunks)
  • api/resources/lang/fr/validation.php (1 hunks)
  • api/resources/lang/gl/validation.php (1 hunks)
  • api/resources/lang/hi/validation.php (1 hunks)
  • api/resources/lang/ja/validation.php (1 hunks)
  • api/resources/lang/jv/validation.php (1 hunks)
  • api/resources/lang/ko/validation.php (1 hunks)
  • api/resources/lang/mr/validation.php (1 hunks)
  • api/resources/lang/pa/validation.php (1 hunks)
  • api/resources/lang/pl/validation.php (1 hunks)
  • api/resources/lang/pt-BR/validation.php (1 hunks)
  • api/resources/lang/pt/validation.php (1 hunks)
  • api/resources/lang/ru/validation.php (1 hunks)
  • api/resources/lang/sk/validation.php (1 hunks)
  • api/resources/lang/sv/validation.php (1 hunks)
  • api/resources/lang/ta/validation.php (1 hunks)
  • api/resources/lang/te/validation.php (1 hunks)
  • api/resources/lang/tr/validation.php (1 hunks)
  • api/resources/lang/ur/validation.php (1 hunks)
  • api/resources/lang/vi/validation.php (1 hunks)
  • api/resources/lang/zh-CN/validation.php (1 hunks)
  • api/resources/lang/zh/validation.php (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • api/resources/lang/es/validation.php
  • api/resources/lang/zh/validation.php
  • api/resources/lang/mr/validation.php
  • api/resources/lang/ta/validation.php
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build the Nuxt app
🔇 Additional comments (26)
api/resources/lang/gl/validation.php (1)

121-122: LGTM! Accurate Galician translations.

The translations for "yes" (Si) and "no" (Non) are correctly added in Galician.

api/resources/lang/sv/validation.php (1)

121-122: LGTM! Accurate Swedish translations.

The translations for "yes" (Ja) and "no" (Nej) are correctly added in Swedish.

api/resources/lang/hi/validation.php (1)

121-122: LGTM! Accurate Hindi translations.

The translations for "yes" (है) and "no" (नहीं) are correctly added in Hindi.

api/resources/lang/eu/validation.php (1)

121-122: LGTM! Accurate Basque translations.

The translations for "yes" (Bai) and "no" (Ez) are correctly added in Basque.

api/resources/lang/sk/validation.php (1)

121-122: LGTM! Slovak translations are correct.

The translations for "yes" and "no" are properly localized in Slovak, with correct diacritical marks.

api/resources/lang/ca/validation.php (1)

121-122: LGTM! Catalan translations are correct.

The translations for "yes" and "no" are properly localized in Catalan, with correct accentuation.

api/resources/lang/pa/validation.php (1)

121-122: LGTM! Punjabi translations are correct.

The translations for "yes" and "no" are properly localized in Punjabi, using correct Gurmukhi script.

api/resources/lang/pt-BR/validation.php (1)

185-186: LGTM! Brazilian Portuguese translations are correct.

The translations for "yes" and "no" are properly localized in Brazilian Portuguese, with correct accentuation.

api/resources/lang/ru/validation.php (1)

121-122: LGTM! Accurate Russian translations.

The translations for "yes" (Да) and "no" (Нет) are correct and properly formatted.

api/resources/lang/de/validation.php (1)

121-122: LGTM! Accurate German translations.

The translations for "yes" (Ja) and "no" (Nein) are correct and properly formatted.

api/resources/lang/bn/validation.php (1)

121-122: LGTM! Accurate Bengali translations.

The translations for "yes" (হ্যাঁ) and "no" (না) are correct and properly formatted.

api/resources/lang/tr/validation.php (1)

138-139: LGTM! Accurate Turkish translations.

The translations for "yes" (Evet) and "no" (Hayır) are correct and properly formatted.

api/resources/lang/te/validation.php (1)

121-122: LGTM! Telugu translations added correctly.

The translations for 'yes' ('అవును') and 'no' ('కానీ') are properly added to the Telugu validation file.

api/resources/lang/ko/validation.php (1)

121-122: LGTM! Korean translations added correctly.

The translations for 'yes' ('예') and 'no' ('아니오') are properly added to the Korean validation file.

api/resources/lang/zh-CN/validation.php (1)

101-102: LGTM! Chinese translations added correctly.

The translations for 'yes' ('是') and 'no' ('否') are properly added to the Chinese validation file.

api/resources/lang/pl/validation.php (1)

121-122: LGTM! Polish translations added correctly.

The translations for 'yes' ('Tak') and 'no' ('Nie') are properly added to the Polish validation file.

api/resources/lang/ur/validation.php (1)

121-122: LGTM! Correct Urdu translations added.

The translations for 'yes' ('ہے') and 'no' ('نہیں') are accurate in Urdu.

api/resources/lang/ar/validation.php (1)

121-122: LGTM! Correct Arabic translations added.

The translations for 'yes' ('نعم') and 'no' ('لا') are accurate in Arabic.

api/resources/lang/vi/validation.php (1)

121-122: LGTM! Correct Vietnamese translations added.

The translations for 'yes' ('Có') and 'no' ('Không') are accurate in Vietnamese.

api/resources/lang/pt/validation.php (1)

121-122: LGTM! Correct Portuguese translations added.

The translations for 'yes' ('Sim') and 'no' ('Não') are accurate in Portuguese.

api/resources/lang/ja/validation.php (1)

121-122: LGTM! Correct Japanese translations added.

The translations for 'yes' (はい) and 'no' (いいえ) are accurate and properly placed at the end of the validation messages array.

api/resources/lang/jv/validation.php (1)

121-122: LGTM! Correct Javanese translations added.

The translations for 'yes' (Ya) and 'no' (Tidak) are accurate and properly placed at the end of the validation messages array.

api/resources/lang/en/validation.php (1)

155-156: LGTM! English translations added.

The translations for 'yes' (Yes) and 'no' (No) are properly placed at the end of the validation messages array.

api/resources/lang/cs/validation.php (1)

121-122: LGTM! Correct Czech translations added.

The translations for 'yes' (Ano) and 'no' (Ne) are accurate and properly placed at the end of the validation messages array.

api/resources/lang/fr/validation.php (1)

121-122: LGTM! Accurate French translations added.

The translations for 'yes' and 'no' are correctly added with proper French translations 'Oui' and 'Non'.

api/app/Service/Forms/FormSubmissionFormatter.php (1)

216-216: LGTM! Proper implementation of localized checkbox values.

The implementation correctly uses the trans() function to fetch localized strings for checkbox values, which aligns with the PR objective of adding localized 'Yes' and 'No' translations.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JhumanJ JhumanJ merged commit 308ce70 into main Feb 24, 2025
7 checks passed
@JhumanJ JhumanJ deleted the ESC-483-form-language-for-submission-checkbox-yes-no branch February 24, 2025 09:08
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