Internationalize more strings and changes in the framework to support more internationalized strings
[!CAUTION] The Volto Team has suspended its review of new pull requests from first-time contributors until the release of Plone 7, which is preliminarily scheduled for the second quarter of 2026. Read details.
- [x] I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.
- [x] I verified there aren't other open pull requests for the same change.
- [x] I followed the guidelines in Contributing to Volto.
- [x] I successfully ran code linting checks on my changes locally.
- [x] I successfully ran unit tests on my changes locally.
- [x] I successfully ran acceptance tests on my changes locally.
- [x] If needed, I added new tests for my changes.
- [ ] If needed, I added documentation for my changes, either in the Storybook or narrative documentation.
- [x] I included a change log entry in my commits.
If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.
Closes #7510
If your pull request includes changes to the documentation—either in narrative documentation, Storybook, or configuration—then a pull request preview will be generated and a link will populate in the description of your pull request below.
By clicking that link, you can use the visual diff menu in the upper right corner to navigate to pages that have changes, then display the diff by checking the Show diff checkbox.
I would like these changes to be backported to 18.x.x too.
We need this, the changes are really necessary, they add missing translatable messages here and there, but we need to fix the tests before continuing.
@erral, thank you for your support on this issue. I have some questions:
-
I have done the Spanish translation for Volto and
volto-slate, so I push it in this pull request or in another pull request separated? -
I still can't get the
make i18ncommand or thepnpn i18ncommand to extract the strings from thevolto-slatepackage, I can't figure out how to do that, it's as that thevolto-slatepackage was excluded, as I understand the packages/scripts/i18n.cjs script is the one in charge of extracting the strings. Could you help me resolve this? any ideas or comments are welcome.
@erral, thank you for your support on this issue. I have some questions:
- I have done the Spanish translation for Volto and
volto-slate, so I push it in this pull request or in another pull request separated?
Separated, please
- I still can't get the
make i18ncommand or thepnpn i18ncommand to extract the strings from thevolto-slatepackage, I can't figure out how to do that, it's as that thevolto-slatepackage was excluded, as I understand the packages/scripts/i18n.cjs script is the one in charge of extracting the strings. Could you help me resolve this? any ideas or comments are welcome.
Let me check this.
I have been checking the test errors and the PR requires some slight modification, I have them in a separated branch if you want yo have a look i18n-support-erral
I'm afraid I won't be able to check ot until next week.
Please configure your editor not to make whitespace changes in unrelated files in PRs. It adds noise that makes reviewing what you want to merge more difficult than it should be.
@stevepiercy first of all thanks for your comment, it is always good to receive feedback on this work, I executed locally all the commands like make format, make lint and make tests so that everything was ok before submitting this PR, but if another validation needs to be added, I think it should be added in those validators for whitespace changes, because I did the necessary procedure to do the PR. I think that the make format command should be able to change that, don't you think?
Please configure your editor not to make whitespace changes in unrelated files in PRs. It adds noise that makes reviewing what you want to merge more difficult than it should be.
@stevepiercy first of all thanks for your comment, it is always good to receive feedback on this work, I executed locally all the commands like
make format,make lintandmake testsso that everything was ok before submitting this PR, but if another validation needs to be added, I think it should be added in those validators for whitespace changes, because I did the necessary procedure to do the PR. I think that themake formatcommand should be able to change that, don't you think?
We don't format .md files because there is no standard. It looks like you've configured your editor to trim trailing white space for all files. That's fine, but formatting unrelated files should always be in a separate PR dedicated to formatting changes only.
@macagua I have been working on top of your PR, I hope that it's OK for you.
I have added some more messages, changed in some places the way to access intl and added a way to allow the schema to be a function (to be able to inject intl into it) for the layout schema builder.
@stevepiercy when asking a separate PR in https://github.com/plone/volto/pull/7511#issuecomment-3418344874 I was referring to the translation changes itself, no to another PR for changes in volto-slate, I think it is OK to have the changes here and the PO changes in another PR.
Moreover, I would say that we shouldn't change the defaultMessages and msgids as @stevepiercy suggests, because in the PR what we have done is to extract the existing English messages to translatable strings, at least for those in defaultMessage. Anyway, if they are gramatically incorrect, we should fix them, but I leave that analysis for a native speaker.
I have reviewed all comments and fixed the missing tests.
I would like a second review @macagua and @stevepiercy
We are aiming this PR to 19.x.x so changing some interface messages should be OK. If we backport this to 18.x.x, we should keep the old messages there.
Regarding the implementation the only thing that bothers me is introducing the <IntlProvider> in the Html component to be able to call intl.formatMessage to translate some aria-label attributes, I don't know whether it can create some other side effect, so any other review would be welcomed here @wesleybl @sneridagh or @davisagli, perhaps.
Thanks.
yeah, but I need to update the source file, updating the pot file is not enough
@stevepiercy I updated the source file and updated the PO files
yeah, but I need to update the source file, updating the pot file is not enough
Understood, but doing a review on all the related source and .po files felt redundant to me. I know you know this, so I didn't mention it. For people who I don't know whether they know, I'd point it out. Thank you!