refactor(i18n): combine language-specific field configs into one mult…#649
Merged
Conversation
rav3n11
force-pushed
the
refactor/combine-field-configs
branch
from
December 16, 2025 11:00
0484e6c to
e8585ef
Compare
Collaborator
|
@copilot review |
Contributor
There was a problem hiding this comment.
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
resolveLocalehelper 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
force-pushed
the
refactor/combine-field-configs
branch
from
December 16, 2025 13:52
e8585ef to
ed1b7ba
Compare
rav3n11
force-pushed
the
refactor/combine-field-configs
branch
from
December 16, 2025 13:59
ed1b7ba to
8c41338
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ilingual file