Multilingual site with aliases has behaves odd when using GlobalArea

Permalink
Hi everyone,

I have a problem with multilingual site when using page aliases and GlobalAreas. The problem is that for some reason the when you go to a page that is alias it only picks up default language from "Stacks & Global Areas" even tho the alias page you are on is in different language.

Concrete5 version 8.5.1 and did not see fix to this problem listed in 8.5.2, I'm quite sure this used to work fine.

I'm hoping for a quick bandage. :P And hopefully not this solution below where I skip the use of "Stacks & Global Areas" language function as that would be many hours of work with this site as it has over 20 languages.

$getLanguageIndicator = preg_split('/\//', $c->getCollectionPath());
$lang=$getLanguageIndicator[1].' ';
...
<?php $top_navigation = new GlobalArea(&lang.'Top-navigation'); $top_navigation->display($c); ?>


Anyway here is a link to one of the page aliases that is causing problems, everything is supposed to be in english, but default language in "Stacks & Global Areas" has finnish in it so it uses that instead of the en_US:
https://www.avanttecno.com/us/top-menu/about-us...

Here is link straight to the same page without page alias:
https://www.avanttecno.com/us/about-us...

Sidenote: I'm not the creator of this site, I'm just helping them out with problems they have

EDIT: also noticed that the flag on the right side of the editor panel changes to flag of Finland even tho the URL is correct and you obviously are on page that is in en_US also it does not select fi_FI as a language as it does not disappear from the list on languages.

Cheers, Petro

 
onemhz replied on at Permalink Best Answer Reply
onemhz
try to:

preg_match('/\/(..)\//', $c->getCollectionPath(), $getLanguageIndicator);
$lang=$getLanguageIndicator[1].' ';
...
<?php $top_navigation = new GlobalArea($lang.'Top-navigation'); $top_navigation->display($c); ?>