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

fix(i18n): allow locale plugins to translate "All fields" field group #7117

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Jul 9, 2024

Description

The "All fields" field group is currently not translatable - this is an oversight on our part.
This PR allows field groups the ability to specify i18n titles, in the same way that certain other schema level properties can (sort orders, for instance).

Additionally, it introduces a new i18n key: inputs.object.field-group-tabs.all-fields-title - which is used by the default "All fields" group.

What to review

  • The studio builds as before
  • Navigating to the new "field groups with i18n" debug type should show three field groups; 🇺🇸 Group 1 (translated through i18n.title), intentionally-missing-key (defined through i18n.title, but does not exist, ergo not translated) and 🌐 Non-i18n group (title set directly on title property, no i18n in play)

Testing

Added basic e2e tests that show the expected outcome on the i18n field group debug schema test.

Notes for release

None, for now. Since users cannot currently switch between locales, it makes more sense to wait to document this when we do allow users to switch. Right now it is easier to just define the localized title straight on the title property.

This still has value for locale packs, but those should automatically pick up and AI-translate the "All fields" group after release.

@rexxars rexxars requested a review from a team as a code owner July 9, 2024 22:33
@rexxars rexxars requested review from juice49 and removed request for a team July 9, 2024 22:33
Copy link

vercel bot commented Jul 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:53pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:53pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:53pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:53pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:53pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jul 10, 2024 3:53pm

@rexxars rexxars changed the title Fix/i18n all fields title fix(i18n): allow locale packs to translate "All fields" field group Jul 9, 2024
@rexxars rexxars changed the title fix(i18n): allow locale packs to translate "All fields" field group fix(i18n): allow locale plugins to translate "All fields" field group Jul 9, 2024
Copy link
Contributor

github-actions bot commented Jul 9, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Jul 9, 2024

Component Testing Report Updated Jul 10, 2024 3:57 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 38s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 7s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 28s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 33s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 15s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 29s 4 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 39s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 18s 20 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 8s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 23s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 16s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 9s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 1m 44s 30 0 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 20s 3 0 0

Copy link
Member

@cngonzalez cngonzalez left a comment

Choose a reason for hiding this comment

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

Changes make sense to me, thank you!

@rexxars rexxars added this pull request to the merge queue Jul 11, 2024
Merged via the queue into next with commit 24f9936 Jul 11, 2024
42 checks passed
@rexxars rexxars deleted the fix/i18n-all-fields-title branch July 11, 2024 13:04
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