Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I have a issue in rendering the translated content for different languages after adding the country path as suffix.
Modules used :
Domain access, country path and enabled multilingual for the site.
Example path :
after i'm switching the url to
It's picking the english content only instead of spanish.
Could anyone help me out to fix this issue?
Thanks in advance.
Regards,
Guru
Comment | File | Size | Author |
---|---|---|---|
#19 | country-path.mp4 | 14.78 MB | sergei_semipiadniy |
#18 | composer_json.txt | 3 KB | Wilfred Waltman |
#16 | composer.json_.txt | 1.34 KB | sergei_semipiadniy |
#14 | detection-and-selection.png | 174.47 KB | sergei_semipiadniy |
#5 | Screen Shot 2017-03-13 at 1.27.43 PM.png | 154.13 KB | shaisamuel |
Comments
Comment #2
gurumurthy@drupal CreditAttribution: gurumurthy@drupal commentedComment #3
shaisamuel CreditAttribution: shaisamuel commentedSame issue here. This is similar to #2790683-11: Conflict with Path prefix for language detection drupal 8:
D8-8.2.5 with installed modules:
If a country path is there in the URL, it always returns default language contents. Works with Domain Language default language, but disregard the Language choice. Both returns English version (default domain language):
Same for front page choice, both will return English documents ((default domain language):
Comment #4
itsekhmistro CreditAttribution: itsekhmistro at Adyax commentedHi,
Could you specify what configuration do you have for Language Detection at /admin/config/regional/language/detection ?
I will try to look into details tonight.
Comment #5
shaisamuel CreditAttribution: shaisamuel commentedHi itsekhmistro,
It's the defaults, URL and Select language. Part of the URL that determines language=Path prefix
Thanks
Comment #6
shaisamuel CreditAttribution: shaisamuel commentedAny update?
Comment #7
axooh CreditAttribution: axooh at Gridonic commentedSame issue here as described in #3.
Comment #8
itsekhmistro CreditAttribution: itsekhmistro at Adyax commentedFrom what I see the issue was related to the Cache context. And it was fixed.
Please let me know if it is still actual for you.
Comment #9
yivanov CreditAttribution: yivanov commentedI can confirm that the issue still persists. I have the same problem now with the language switching.
Comment #10
yivanov CreditAttribution: yivanov commentedComment #11
zrashevskaya CreditAttribution: zrashevskaya at Adyax commentedHi yivanov, could you please provide detailed steps and configuration details to reproduce this issue.
I can't reproduce it with the last release of country_path module and basic settings from #5.
Comment #12
arulraj CreditAttribution: arulraj commentedSteps to reproduce this issue:
Expectation: Need to display translated content based on language selected.
Comment #13
Wilfred Waltman CreditAttribution: Wilfred Waltman as a volunteer commentedI experience the same issue as mentioned in #12
Comment #14
sergei_semipiadniy CreditAttribution: sergei_semipiadniy as a volunteer and at Globalbility commentedHi all,
As far as Country Path module provides own language negotiation plugin I think we should try to use it to correctly detect language prefix on domains like drupal8.com/us.
@arulraj, I add several steps to your list, they are bolded:
@wilfred-waltman, @arulraj have you used contry_path's detection method ?
Thanks in advance!
Comment #15
Wilfred Waltman CreditAttribution: Wilfred Waltman as a volunteer commented@sergei_semipiadniy,
I have the Domain Country Path module installed, and selected the country_path selection method. And the most recant versions of Drupal, Domain, and Domain Country Path. So basicly just the way you suggest in #14 and with that setup I experience the issue.
Comment #16
sergei_semipiadniy CreditAttribution: sergei_semipiadniy as a volunteer and at Globalbility commented@wilfred-waltman,
I tested country_path (v1.1) with latest stable versions of Drupal and domain (8.6.3 and 1.0-alpha14). And it works fine for me.
Also, I attached my composer.json file as example.
Maybe other contrib modules impact on country_path's behavior.
@wilfred-waltman, could you please attach your composer.json, so that I could build Drupal instance with yours set of contribs?
Regards!
Comment #17
sergei_semipiadniy CreditAttribution: sergei_semipiadniy as a volunteer and at Globalbility commentedComment #18
Wilfred Waltman CreditAttribution: Wilfred Waltman as a volunteer commented@sergei_semipiadniy, here it is...
Comment #19
sergei_semipiadniy CreditAttribution: sergei_semipiadniy as a volunteer and at Globalbility commented@wilfred-waltman,
I set up Drupal instance using your composer.json and I tested it successfully.
I recorded small video. Please look on it and let me know if you find some difference with yours reproducing.
Regards!
Comment #20
Wilfred Waltman CreditAttribution: Wilfred Waltman as a volunteer commentedThe only things I see is that I didn't have all the Domain sub modules enabled. And I do have the Pathauto module enabled. Other then that I have the sam setup. But I will give it another go with the other modules enabled as well.
Thanks for your time and responses.
Comment #21
dipikas CreditAttribution: dipikas commentedHi All,
Pathauto module is conflicting with country path module.When I am adding URL pattern for content type its showing node/1, not showing the page title.If anyone has got solution please suggest.
Thanks,
Dipika
Comment #22
nikolay.sh CreditAttribution: nikolay.sh at Adyax commentedHello,
I'm also cannot reproduce the issue described in the comment #12.
( tested with enabled cache and under anonymous user )
Works correctly as for @sergei_semipiadniy.
Drupal Core: 8.6.13
Domain: 8.x-1.0-alpha15
Country Path: 8.x-1.2
Pathauto: 8.x-1.3
Pathauto patterns also works correctly (comment #21).
Closed for now. Feel free to reopen if issue still persists
Thanks.
Comment #23
adinac CreditAttribution: adinac as a volunteer commentedHello,
I'm also experiencing this issue, with:
Drupal Core: 8.7.3
Domain: 8.x-1.0-alpha16
Country Path: 8.x-1.2
Pathauto: 8.x-1.4
I have two domains:
https://example-site.lndo.site/int - with just English (the default language, and has no language prefix)
https://example-site.lndo.site/ch with English and German (with 'de' as the language prefix)
A "Test Page" node which is translated in both English and German, and also has a path alias, which is also translated in English and German, and is available only on the Switzerland domain https://example-site.lndo.site/ch
If I access
https://example-site.lndo.site/ch/test-page - all is ok
https://example-site.lndo.site/ch/de/de-test-page - Page not found
https://example-site.lndo.site/ch/de/test-page - displays the English translation of the page
Comment #24
JamieP CreditAttribution: JamieP commentedI was having this issue and resolved it with a 1 line configuration update after a lot of debugging. I'm running:
In language.types.yml, ensure that "country-path-language-url" is enabled under language_url, for example:
Background
The UI at /admin/config/regional/language/detection only allows interface & content language types to be enabled/configured. There doesn't seem to be a way to do this for url language types.
The LanguageNegotiationCountryPathUrl plugin annotation indicates the negotiation method is applicable to LanguageInterface::TYPE_URL, but for some reason this was not picked up during my initial config export. The site was installed from a custom profile, so this may be related to https://www.drupal.org/project/drupal/issues/2666998.
As the plugin was not enabled under language_url, aliases were not working (relates to https://www.drupal.org/node/1125428).
My setup was as follows:
Domains
Language URL prefixes
(configured at /admin/config/regional/language/detection/url):
Test cases
When I created a new node in English with the URL /my-page (without creating any translations), navigation resulted in the following:
However, the site did behave as expected when accessing nodes with unaliased paths:
Analysis
The reason for this was that my region path suffixes (de & fr) are also valid language codes, so the default language_url negotiator was detecting the first argument as the langcode, rather than the second.
When I accessed www.example/fr/en/my-page for example, the system was looking for "/my-page" in as an fr language alias, not en.
The /world/en URL only worked because "world" is not a valid langcode, and therefore the language_url defaulted to en, so the "/my-page" alias was found.
After updating language.types.yml, all URLs worked as expected because the country path negotiator was active during url alias detection.
Hope that helps anyone else that finds themselves in this situation.
Comment #25
JamieP CreditAttribution: JamieP commentedComment #26
JamieP CreditAttribution: JamieP commented