I have a website in french (fr) and english (en), in :

/admin/config/regional/language/detection/session

I added to "Query / Session Parameter" lang

Currently, if I translate the site, the url looks like :

https://www.mydomaine.com/?lang=en for English

https://www.mydomaine.com/?lang=fr for French

How to fill language settings in metatags for nodes ?

Comments

zenimagine created an issue. See original summary.

zenimagine’s picture

Issue summary: View changes
damienmckenna’s picture

zenimagine’s picture

StatusFileSize
new32.49 KB

Thank you, but I do not know how to fill these fields. I added a new screenshot. Is it well filled?

If I use "Query / Session Parameter" lang

damienmckenna’s picture

First off - you aren't using the 'URL' option for language detection? That would make it so you go to e.g. https://www.mydomaine.com/fr/ for French, https://www.mydomaine.com/en/ for English, etc, which results in tidier URLs.

zenimagine’s picture

StatusFileSize
new15.5 KB

Using this method will break the link I already have on my site. I would like to do like twitter and use the url parameter.

You advised against this way of doing things ?

damienmckenna’s picture

Status: Active » Fixed

I guess if it works for you then so be it.

And in that case, using [node:url:absolute]?lang=LANGCODE would work for you.

zenimagine’s picture

StatusFileSize
new55.17 KB

Ok, what should I put in "Default locale (x-default)"?

I have content to create in English and translated into French.

I also have French content translated into English.

Which token to use?

Another question :

If I opt for directories:

https://www.mydomaine.com/fr/article/nid

I have a lot of views on my site that uses the "Raw value from URL" context filter. How is it going with a directory? the current value is 2. Do I have to change it to 3?

damienmckenna’s picture

The 'x-default' value is supposed to point to the source language for the content, and the hrelang value for that language is supposed to be empty; there's custom logic in the D7 version to handle this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.