Skip to content

Multi-language site profile : Add language / rename language code #2036

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
harikt opened this issue Feb 6, 2025 · 9 comments
Open

Multi-language site profile : Add language / rename language code #2036

harikt opened this issue Feb 6, 2025 · 9 comments

Comments

@harikt
Copy link

harikt commented Feb 6, 2025

I did wrote about the issue over https://processwire.com/talk/topic/31011-adding-language-changing-language-is-not-reflecting-on-the-front-end/

What I noticed is when new language is added, it is not adding value to the page id 1, which have a name* field and is missing the new value.

Image

The behaviour when we rename the existing language code ( de => uk ) is not updating this field value.

@ryancramerdesign
Copy link
Member

@harikt The language name (in Setup > Languages) and the URL prefix that it uses are two different things. For instance your language name might be "spanish" or "es-br" but your URL prefix might just be "es". Though it's also fine if they have the same value. But to edit the prefix that is used in the URL, you would have to edit your homepage and then click on the Settings tab. There's more about this here.

@BernhardBaumrock
Copy link

BernhardBaumrock commented Feb 6, 2025

@ryancramerdesign while I understand from a technical point of view that language url values are setup on the home page I also see that this could be improved a lot from the user perspective. I think it would be great to have an inputfield on the language edit page that makes it possible to set the url value (example.com/de) directly there. It could internally just set the value on the homepage, but as a user I think it's much more intuitive to define the language url value under "setup > languages > en > url value" than going to "Pages > Home > Edit > Settings > Page Name"

@BernhardBaumrock
Copy link

Or maybe even a hint to instruct the user what to do in case he/she wants to change the language slug would already be a great addition in my opinion :)

@harikt
Copy link
Author

harikt commented Feb 7, 2025

@ryancramerdesign anyway there is a bug or people may not understand what went wrong.

I added a new language with title Test and name as test.

As you mentioned about the home page settings contains the prefix, I checked there.

Image

This is pointing to en . As a user I expect it to be same as the name I have entered. I can ignore about the edit, but at-least the add should work as expected.

@ryancramerdesign
Copy link
Member

@BernhardBaumrock The page names in this case are properties of the page, not of the language. If your site has 100 pages then all 100 of the page names for each language are edited on the Settings tab of that page editor. That's also where they are enable or disabled for each page. It would be pretty inconsistent if we said "edit them all here, except for the homepage, which you should edit over there instead."

@harikt I think I don't understand what you are seeing yet. If you think there is a bug, can you describe in more detail how to duplicate it? If you added a new language named "test" then edited the homepage (or any page) then you should have an input for the page name in that language. In your screenshot it shows "en" for your new language, overlapping your other language. That's fine and page names are allowed to overlap for different languages (some words are spelled the same in different languages). But to make it easier for PW to detect a language, it would be preferable to use something other than "en". Or if you want to use "en" then delete the "en" for your default language (which would be the most common setup). Also have a look at the additional settings in Modules > LanguageSupportPageNames.

@BernhardBaumrock
Copy link

BernhardBaumrock commented Feb 7, 2025

@ryancramerdesign I think you misunderstood my request! Also I think your example just shows one use case, but I think my mentioned use case is much more likely. Who ever wants to change 100 page names??

But I don't want to hijack this thread so I created a request that should explain what I tried to say: processwire/processwire-requests#557

@harikt
Copy link
Author

harikt commented Feb 7, 2025

@ryancramerdesign , this is what I am doing. Not sure if this is expected.

Adding a language :

I added a new language with title and name as shown in screenshot.

Image

Once I added the language, I am editing the home page and moving to Settings tab.

Image

In this view, I was expecting the last text field value with label Test to be test and not as en. If this behavior is correct, we can close the issue,

@BernhardBaumrock
Copy link

@harikt I just tested and can confirm this:

My default language is Deutsch with no url segment. The newly added language "ProcessWireish" has no url segment setup yet, so it shows no segment:

Image

I then added "de" as url segment of the default language and hit save:

Image

--> Result is it shows /de/ for the ProcessWireish language as well. Which is misleading at least.

@harikt not sure if you are just reporting the behaviour or also need a solution? To solve this you can just override the url segment with your own (test in your case, pw in my case):

Image

@harikt
Copy link
Author

harikt commented Feb 7, 2025

@BernhardBaumrock I got the solution. I was expecting this as a bug which was misleading when you add a language. Now I know the details. Thank you all. A reply from forum also tells this is expected. https://processwire.com/talk/topic/31011-adding-language-changing-language-is-not-reflecting-on-the-front-end/#comment-247339 . So @ryancramerdesign you can take the necessary action for the issue.

Thank you all.

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

No branches or pull requests

3 participants