View previous topic :: View next topic |
Author |
Message |
brainwave Smarty Rookie
Joined: 09 Jul 2003 Posts: 22
|
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Mon Sep 13, 2004 10:59 am Post subject: |
|
|
Quote from your link...
Quote: |
The language will be determined by the browser settings. If you want
to change it explicitly you can use something like this:
<?php
$smarty = new smartyML("de"); // now the language will be german regardless of the browser settings
// [...]
// $smarty->assign(...);
$smarty->display("myTemplate.tpl");
?>
|
|
|
Back to top |
|
brainwave Smarty Rookie
Joined: 09 Jul 2003 Posts: 22
|
Posted: Mon Sep 13, 2004 11:29 am Post subject: |
|
|
yeah ok I know that but I need the browser setting language that the plugin uses in an php-var to use it on an other location too.
something like:
$language = $smarty->getML_language();
echo $language;
Results (for example):
de |
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Mon Sep 13, 2004 1:37 pm Post subject: |
|
|
Have a try:
[php:1:812ea66808]
echo $smarty->language->_currentLocale;
[/php:1:812ea66808] |
|
Back to top |
|
brainwave Smarty Rookie
Joined: 09 Jul 2003 Posts: 22
|
Posted: Tue Sep 14, 2004 7:42 am Post subject: |
|
|
thx but this don't work for me...but It brings me to this:
echo $GLOBALS['_NG_LANGUAGE_']->_currentLocale;
and this worked. Thx Kills.
But one more question. I'm not the PHP Champion so I don't know how secure is this GLOBALS thing. Can you help me again? |
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Wed Sep 15, 2004 6:08 am Post subject: |
|
|
i think you can work with this global var. There are no security problems, i think.
Read more about global vars on www.php.net |
|
Back to top |
|
brainwave Smarty Rookie
Joined: 09 Jul 2003 Posts: 22
|
Posted: Wed Sep 15, 2004 11:20 am Post subject: |
|
|
thx kills
now I have one more question. anyone here who uses this plugin and who knows how I include a 2nd language file to the global one? |
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Wed Sep 15, 2004 1:05 pm Post subject: |
|
|
brainwave wrote: | thx kills
now I have one more question. anyone here who uses this plugin and who knows how I include a 2nd language file to the global one? |
take a look on the page examples |
|
Back to top |
|
|