This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Bruno 5 months, 1 week ago.

Assigned support staff: Bruno.

Author Posts
May 14, 2019 at 9:51 pm #3810867

andyT-11

Hi WPML Team,

How could I set Different languages in directories? I read the documentation of WPML about the setting, but I don't understand it. It is a new wordpress site. I could provide the login details. Should I choose the HTML file – please enter path: absolute or relative to the WordPress installation folder or A Page? Where could I find the HTML File pate or how could I create the page? Thanks.

May 14, 2019 at 10:36 pm #3810973

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for contacting us. This option will make your site accessible this way, for example:

Primary language (en): site.com/en/
Secondary language (fr): site.com/fr/

The root page will be the page you are going to display when the site is displayed without the language code: site.com/

The root page will be created as you want. This can be any page to choose the language, for example, "Choose the language in which you want to visit the site". This page will be created by you, manually.

Here is our documentation with more details: https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

That is, the root page is the page you will design manually to be displayed when your site is accessed without the language code.

Thank you.

May 15, 2019 at 6:55 am #3812747

andyT-11

Hi Bruno, thank you. I could set up the page already. I set the English as a default language.

site.com
site.com/fr
site.com/zh-hans

etc.

However, when I enter site.com, it will be transferred to site.com/en. the url will have "/en" at the end. See attached screenshot S1.PNG & S2.PNG. How can I set the site.com is site.com and the default language is English.

And what does "hide language switchers on the root page" mean? after ticking the box, I could still see the language switcher on the root page (which is set to be a home page for me). If I tick the box, does the language switcher become disappear in the root page and the users cannot change to another language at the root page?

May 15, 2019 at 6:46 pm #3819645

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

>>> However, when I enter site.com, it will be transferred to site.com/en. the url will have "/en" at the end. See attached screenshot S1.PNG & S2.PNG. How can I set the site.com is site.com and the default language is English.

In this case, by setting the "Use directory for default language" the URL mapping would be:

- site.com <- root URL
- site.com/en <- English
- site.com/fr <- French
- site.com/zh-hans <- Chinese

The option for "Use directory for default language" is just to create this root page, which will be used without specifically defining a language. That is, your English domain is set to "/en" is expected when this option is set.

Unfortunately, it is not possible to map the URL to these two ways: site.com and site.com/en = English. By setting a root page, site.com will respond for a page (root page) and site.com/en will respond for content in English.

>>> And what does "hide language switchers on the root page" mean? after ticking the box, I could still see the language switcher on the root page (which is set to be a home page for me). If I tick the box, does the language switcher become disappear in the root page and the users cannot change to another language at the root page?

The root page is not yet set on your site. From what it looks like in the screenshot that you posted, you just activated this option but have not yet defined/created a root page. I'll attach an image for you to see.

Thank you.

May 17, 2019 at 7:59 pm #3836785

andyT-11

Thank you. I have set a root page. But I have few questions:

1. After setting a root page, it is site.com. But I cannot find this root page in the section of "All Page", is it alright?

2. If the default Language is English, and the root page is set, should I delete the English WPML or delete the site.com/en?

3. After deleting the site.com/en, could I have the drop-down menu of WPML to choose the en language icon at the site.com/fr page, and click the en icon and change to site.com?

4. How could I set home page or site.com/en to be a root page? or could I set redirection for site.com to site.com/en?

5. I am not sure about if I understand the root page. Does WPML set a landing page (called root page) and the users choose the language before reading the content?

6. Could I set Different languages in directories without html page or root page? enter site.com -> directing to site.com/en.

7. if I do not tick the box of "Use Directory of Default Language", what will be different?

Thanks.

May 18, 2019 at 12:47 am #3837391

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

>>> 1. After setting a root page, it is site.com. But I cannot find this root page in the section of "All Page", is it alright?

Yes. The root page does not appear in the page list.

>>> 2. If the default Language is English, and the root page is set, should I delete the English WPML or delete the site.com/en?

Sorry, but I did not understand. As the root page is set, this will only display the root page (site.com page). The English page would be another page. I'm not sure if you should delete another page.

>>> 3. After deleting the site.com/en, could I have the drop-down menu of WPML to choose the en language icon at the site.com/fr page, and click the en icon and change to site.com?

I'm not sure if I get it either. Do you want to add a language selector to switch between French and English? If so, you can see the steps in our documentation: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/.

To return to the root page you will need custom coding or you can add a link to the root domain "site.com" if you prefer.

>>> 4. How could I set home page or site.com/en to be a root page? or could I set redirection for site.com to site.com/en?

They are different page, so it is not possible to use the same page in "site.com" and "site.com/en". In this case, you should have to copy the contents and paste in the root page. That is, two different pages with the same content.

>>> 5. I am not sure about if I understand the root page. Does WPML set a landing page (called root page) and the users choose the language before reading the content?

Basically yes, but with the difference that the page is displayed only if the user accesses a page without the language code in the URL. That is, not necessarily all the content that the user sees will appear the root page (or landing page). Only if the user accesses the URL without the language code.

site.com <- display the root page
site.com/en <- display the english content
site.com/fr <- display the french content

>>> 6. Could I set Different languages in directories without html page or root page? enter site.com -> directing to site.com/en.

In this case, the work of doing this redirect would be just the root page. Note that doing this redirect would require custom coding.

>>> 7. if I do not tick the box of "Use Directory of Default Language", what will be different?

site.com <- display the default language content
site.com/fr <- display the secondary language content

Thank you.