volto icon indicating copy to clipboard operation
volto copied to clipboard

Internationalize more strings and changes in the framework to support more internationalized strings

Open macagua opened this issue 2 months ago • 12 comments

[!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.



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.

macagua avatar Oct 17 '25 22:10 macagua

I would like these changes to be backported to 18.x.x too.

erral avatar Oct 18 '25 07:10 erral

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 avatar Oct 18 '25 08:10 erral

@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 i18n command or the pnpn i18n command to extract the strings from the volto-slate package, I can't figure out how to do that, it's as that the volto-slate package 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.

macagua avatar Oct 18 '25 11:10 macagua

@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 i18n command or the pnpn i18n command to extract the strings from the volto-slate package, I can't figure out how to do that, it's as that the volto-slate package 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.

erral avatar Oct 18 '25 11:10 erral

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?

macagua avatar Oct 19 '25 16:10 macagua

Please move volto-slate translations to a separate PR, per #7511 (comment).

@stevepiercy Sure :-)

macagua avatar Oct 19 '25 16:10 macagua

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?

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.

stevepiercy avatar Oct 20 '25 02:10 stevepiercy

@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.

erral avatar Oct 21 '25 20:10 erral

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.

erral avatar Oct 26 '25 11:10 erral

yeah, but I need to update the source file, updating the pot file is not enough

erral avatar Oct 26 '25 13:10 erral

@stevepiercy I updated the source file and updated the PO files

erral avatar Oct 26 '25 17:10 erral

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!

stevepiercy avatar Oct 26 '25 21:10 stevepiercy