Skip to content

FIO-9618: Move I18n shim to core #6042

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

FIO-9618: Move I18n shim to core #6042

wants to merge 2 commits into from

Conversation

blakekrammes
Copy link
Contributor

@blakekrammes blakekrammes commented Mar 7, 2025

  • Move relevant translation strings to core

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-9618

Description

What changed?

As part of the move to render emails in a core processor instead of formio.js, it was necessary to enable I18n translation in core, thus moving the shim from here to there. Since translation is not directly related to rendering formio components it was deemed fitting to move this to core. I have also moved relevant translation strings to core (many of the errors were already present there and have been removed here). The translations left in formio.js should only relate to frontend concerns.

Why have you chosen this solution?

Use this section to justify your choices

Breaking Changes / Backwards Compatibility

Use this section to describe any potentially breaking changes this PR introduces or any effects this PR might have on backwards compatibility

Dependencies

formio/core#235

How has this PR been tested?

Manually

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@blakekrammes blakekrammes force-pushed the fio-9618 branch 2 times, most recently from a363e8d to 958f667 Compare April 3, 2025 17:37
@blakekrammes blakekrammes force-pushed the fio-9618 branch 3 times, most recently from 4de8bfd to 5115a9c Compare April 10, 2025 22:03
- Move relevant translation strings to core
- Add form language to submission metadata
  - Change to eachComponentData in core shows 2 wizard errors instead of 1, which I believe is the correct behavior
  - Relevant commit formio/core@fc8960e#diff-9b18bb8f4f70621ee3d4d779a4293139a5ede3ac9d714d46560027a5e0750faaR86
@@ -563,9 +563,13 @@ describe('Wizard Form with Nested Form validation', () => {
setTimeout(() => {
checkPage(2);
const errors = wizard.errors;
assert.equal(errors.length, 1, 'Must err before next page');
assert.equal(errors.length, 2, 'Must err before next page');
Copy link
Contributor Author

@blakekrammes blakekrammes Apr 11, 2025

Choose a reason for hiding this comment

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

the nested wizard has two required fields on the same page:

  1. formNested.data.textField
  2. formNested.data.dataGrid[0].textField

both are required and should show up in the validation errors, I believe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this commit in core added a new check in eachComponentData that causes both errors to show

formio/core@fc8960e#diff-9b18bb8f4f70621ee3d4d779a4293139a5ede3ac9d714d46560027a5e0750faaR86

@blakekrammes blakekrammes marked this pull request as ready for review April 11, 2025 19:13
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.

1 participant