Page 1 of 1

Display current language name

Posted: Tue Oct 21, 2014 12:08 pm
by Louis7777
OC v1.5.6.4

- I want to display some text about the current language. For example: "Your current language is English."

- I also want to hide the choice for english in the language menu (i.e. the flag).

So I did the following.

1) I tried this:

Code: Select all

<?php echo $_SESSION['language']; ?>
...but it displays the language code not the language name (i.e. "en" instead of "English").

2) I modified the following section of language.tpl :

Code: Select all

<?php foreach ($languages as $language) { ?>
// list language items here
<?php } ?>
And did this:

Code: Select all

<?php foreach ($languages as $language) {  if(strcmp($_SESSION['language'],$language['code']) != 0) ?>
// list language items here
<?php } ?>
I thought that I would compare $_SESSION['language'] and $language['code'] since they both display language codes. And if the session's language (i.e. the current language) is the same as the language code of the language to be listed, then that language shouldn't be listed.

It didn't work. :-\