Skip to content

refactor(i18n): combine language-specific field configs into one mult…#649

Merged
rav3n11 merged 1 commit into
mainfrom
refactor/combine-field-configs
Dec 16, 2025
Merged

refactor(i18n): combine language-specific field configs into one mult…#649
rav3n11 merged 1 commit into
mainfrom
refactor/combine-field-configs

Conversation

@Fidesnoella

Copy link
Copy Markdown
Contributor

…ilingual file

@rav3n11
rav3n11 force-pushed the refactor/combine-field-configs branch from 0484e6c to e8585ef Compare December 16, 2025 11:00
@rav3n11

rav3n11 commented Dec 16, 2025

Copy link
Copy Markdown
Collaborator

@copilot review

Copilot AI commented Dec 16, 2025

Copy link
Copy Markdown

@rav3n11 I've opened a new pull request, #652, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the internationalization (i18n) approach for field configurations by consolidating multiple language-specific YAML files into a single multilingual configuration file. Instead of fetching different files based on the active language (e.g., fields-en-GB.yaml, fields-es-ES.yaml), the system now fetches a single fields.yaml file once and resolves localized values at runtime when the language changes.

Key Changes

  • Introduced a resolveLocale helper function to extract language-specific values from locale maps
  • Split the configuration loading into two phases: fetch once, re-parse on language change
  • Updated YAML structure to store translatable fields as locale maps (e.g., label: { en-GB: "Name", es-ES: "Nombre" })

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
useFieldsConfig.ts Refactored hook to fetch config once and re-parse on language changes; added resolveLocale function and RawFieldConfig type; improved error messages
useFieldsConfig.test.ts Updated test data to use multilingual YAML structure; added tests for language change behavior and parsing error handling
configValidation.test.tsx Updated test configurations to use locale maps for labels, error messages, and values
fields.yaml Converted to multilingual format with locale maps for all translatable fields (labels, error messages, values, question text)
fields-es.yaml Deleted language-specific file (consolidated into fields.yaml)
fields-es-ar.yaml Deleted language-specific file (consolidated into fields.yaml)
fields-en-us.yaml Deleted language-specific file (consolidated into fields.yaml)
fields-en-gb.yaml Deleted language-specific file (consolidated into fields.yaml)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rav3n11
rav3n11 force-pushed the refactor/combine-field-configs branch from e8585ef to ed1b7ba Compare December 16, 2025 13:52
@rav3n11
rav3n11 force-pushed the refactor/combine-field-configs branch from ed1b7ba to 8c41338 Compare December 16, 2025 13:59
@rav3n11
rav3n11 merged commit b890fb5 into main Dec 16, 2025
7 checks passed
@rav3n11
rav3n11 deleted the refactor/combine-field-configs branch December 16, 2025 14:06
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.

4 participants