-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Unable to change language of Volto core #6219
Comments
Did you follow Multilingual, specifically:
|
@stevepiercy but I don't want a multilingual website. I want the website to be in only one language different of English. By the way, I don't know if this option I'm looking for is in the documentation. |
@wesleybl OK, thanks for the explanation. However, would you please try installing that add-on to see if it resolves the issue? I suspect it is a backend dependency for translations in Volto. This option is documented in the Multilingual docs to which I linked and which contain steps similar to what you followed. If I recall correctly, you need to install it even in Classic UI to get a non-English language. I could be wrong, though. Finally Volto has the required pt-br messages at https://github.com/plone/volto/tree/main/packages/volto/locales/pt_BR/LC_MESSAGES, so we can rule that out as a possible cause. |
@stevepiercy I installed
|
I printed the |
@stevepiercy the |
It should still not be necessary, if you only need to support one language. Did you remember to also set the site language correctly in the backend? |
Yes I set the backend language. I tried with Portuguese and Spanish but neither worked. |
The problem originated in PR #6130 by @sneridagh. In it, the volto/packages/volto/src/server.jsx Line 39 in 3c56a14
and the result was the string:
instead of the object like languages: volto/packages/volto/src/constants/Languages.cjs Lines 6 to 22 in 502c0f7
The question is, can I rename it to CC @ichim-david |
@wesleybl awesome debugging, this is what I like about your way of adding issues, you are thorough and it's great that you found where the issue came from. |
@ichim-david since we don't have a https://nodejs.org/api/modules.html#enabling In other words, it is not mandatory for CommonJs modules to have the I changed it to |
@wesleybl I am not sure you are on the right track. The following steps work for me:
So I think the problem is that the Docker backend creates an English site, and there isn't a way to configure that. (The docker image can be configured with the LANGUAGE environment variable, but volto's Makefile isn't setting that for the |
@wesleybl with the tip from @davisagli, can you try editing the Makefile with this: # Volto development
LANGUAGE ?=en
...
.PHONY: backend-docker-start
backend-docker-start: ## Starts a Docker-based backend for development
$(MAKE) -C "./packages/volto/" backend-docker-start -e $(LANGUAGE) Then invoke it with: make backend-docker-start LANGUAGE=pt-br My syntax might be off, but maybe you can fiddle with it to get it right. If it works, then should we add this feature and document it? |
@davisagli that was the problem. It worked by recreating the site. Thanks! But anyway, the I have a portal that is in Portuguese and after updating the Volto version, it stopped translating the strings. I thought that would be the problem, but apparently it isn't. |
@stevepiercy @davisagli now that we have a volume for the backend, I don't know if it would make sense to have this configuration. We would have to remember to use it the first time we use the make command. After that, I don't think it would do anything else, since the portal would already be created. |
@davisagli the strange thing is that recreating the portal works, but when we change the language in http://localhost:3000/controlpanel/language, all the content already created when the portal was in English is still shown in English, even with the portal in Portuguese. That's what confused me. |
In other words, the content language takes precedence over the portal language. This might make sense, but when we test it, it seems like the language change doesn't work. |
Yes, the content language takes precedence over the portal language. It doesn't make a lot of sense and there's been a fair amount of discussion of changing it, but that hasn't happened yet. |
In classic Plone, the portal language takes precedence. |
Can I close this issue and open a specific one for |
@wesleybl Sure -- but I don't want to lose Steve's idea to provide a way to start the backend in Docker with a particular language. I think that would be good to support. |
@davisagli I looked for |
I created a PR in #6231 that captures #6219 (comment). Feel free to do what you want with this issue. |
@davisagli @wesleybl I have tried several solutions to get Languages.cjs object to import and work both in webpack and vite and I couldn't get it to work. |
@davisagli recreating the portal in Portuguese solves the problem on most pages. But on some pages we still have problems. For example, on the content not found page in SSR. If you access a page with no content, the message is in English. Rename |
Describe the bug
I change the language setting to
pt-br
but the interface remains in English. I also tried withes
and it didn't work.To Reproduce
Steps to reproduce the behavior:
volto/packages/volto/src/config/index.js
Lines 122 to 123 in 38844e5
To:
http://localhost:3000/login
with an anonymous user.
Expected behavior
The login form must be in Portuguese
Software (please complete the following information):
Volto 18.0.0-alpha.41
Plone 6.0.11
plone.restapi 9.7.0
CMF 3.5
Zope 5.9
Python 3.11.9 (main, May 14 2024, 08:32:26) [GCC 10.2.1 20210110]
PIL 9.5.0 (Pillow)
The text was updated successfully, but these errors were encountered: