language switch displaying in multi-language

Permalink
I want the language switch to display the languages as NOT translated to the viewing language.

Standard display for a site with languages dutch/german/english, the switch should display like this: nederlands/deutsch/english so every visitor can read the language in their own language.

I use a custom template to display the switch in plain text links:

<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<div class="ccm-block-switch-language-text">
   <div class="ccm-block-switch-language-text-label">
      <?php echo $label?>
   </div>
    <?php foreach($languageSections as $ml) { ?>
        <a href="<?php echo $view->action('switch_language', $cID, $ml->getCollectionID())?>"
           title="<?php echo $ml->getLanguageText($locale)?>"
         class="<?php if ($activeLanguage == $ml->getCollectionID()) { ?>ccm-block-switch-language-active-text<?php } ?>">
         <?php echo $ml->getLanguageText($locale)?>
      </a>
    <?php } ?>
</div>


What should i change to display the values in native language notation?

buurvrouw
View Replies:
mlocati replied on at Permalink Reply
mlocati
I submittedhttps://github.com/concrete5/concrete5/pull/4369...

If it gets accepted, the next concrete5 version will have language names in their own language
buurvrouw replied on at Permalink Reply
buurvrouw
Hi mlocati,

Thanks! That would be very nice :-)
PaiviK replied on at Permalink Reply
PaiviK
It would be great!
Meanwhile just have to live with flags I guess.
Just spent quite a lot of time trying to figure out a solution - other than flags. With the current system it is impossible for a visitor to navigate from japanese pages to english etc.
Xabatar replied on at Permalink Reply
Xabatar
Because Concrete 8.1.0 has major issues with GlobalAreas in a Multilanguage setup, I still had to build websites in 7.5.13. And I got a solution for this problem by using the language root page titles instead of the the given translated names.
Here is what I used for the code:
<a href="<?php echo $view->action('switch_language', $cID, $ml->getCollectionID())?>">
            <?php $pID = $ml->getCollectionID();
                    $page = Page::getByID($pID);  
                    $name = $page->getCollectionName();
                    echo h($name)?></a>