2014-08-12, 23:24:32
use code tags..
That looks correct where you have it now. At the beginning of your component that uses it.
components are called like functions so imagine they are inside a function ( an anonymous function actually )
That is why the global is needed, because that variable is not in your scope.
It is possible your languages are not defined as 2 letter codes?
you can add a debugLog($language); in there and see
maybe you need a strtolower($language) == 'en'.
Not sure, could be language is not set
That looks correct where you have it now. At the beginning of your component that uses it.
components are called like functions so imagine they are inside a function ( an anonymous function actually )
That is why the global is needed, because that variable is not in your scope.
It is possible your languages are not defined as 2 letter codes?
you can add a debugLog($language); in there and see
maybe you need a strtolower($language) == 'en'.
Not sure, could be language is not set
PHP Code:
<?php
global $language;
debugLog($language);
$langlower = strtolower($language);
if ($langlower = 'en') { // you might need to make sure this is case sensitive for all these checks
echo 'Next';
}else if ($langlower = 'de') {
echo 'Naechste';
}else if ($langlower = 'fr') {
echo 'Suivant ';
}
else echo "language not set"; // catch if not set to any of these
?>