Hi mates,
I am developing a new 1.5RC4 site and I have two "flag" buttons on the main page so the user can change "on-the-fly" the site language. On my situation between Portuguese and English.
What parameters should I transform on the index.php (template file) "J" objects so it can be rendered that way ?
In this case, is for "public" view ok ? For registered users I think I know how to do it
Regards and thanks!!!
Changing Site Language "on-the-fly"
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
- infograf768
- Joomla! Engineer
- Posts: 366
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: •Translation Matters•
Re: Changing Site Language "on-the-fly"
The site language can only be changed on a per user basis and only for registered users, as far as I know.
The choice is entered in the database parameters for that user.
As a non-registered user has no entry in the db, how would you change the language?
Change default language? This is also in db and would change for ALL users.
I am not sure that changing the template header has any impact for current strings
As joomfish is not yet available for 1.5, I am curious.
The choice is entered in the database parameters for that user.
As a non-registered user has no entry in the db, how would you change the language?
Change default language? This is also in db and would change for ALL users.
I am not sure that changing the template header has any impact for current strings
As joomfish is not yet available for 1.5, I am curious.
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
Qui vult dare parva non debet magna rogare.
Re: Changing Site Language "on-the-fly"
Hi,
The language is analysed on the "initialise" method on the JApplication class.
So, on the index.php file we have:
if we enter a parameter on the initialise method we would change it, like shown bellow, for portuguese:
I hope this helps other developers that got the same problem as I got.
The language is analysed on the "initialise" method on the JApplication class.
So, on the index.php file we have:
Code: Select all
$mainframe->initialise();
JPluginHelper::importPlugin('system');
if we enter a parameter on the initialise method we would change it, like shown bellow, for portuguese:
Code: Select all
$A = Array();
$A["language"] = "pt-PT";
$mainframe->initialise($A);
JPluginHelper::importPlugin('system');
I hope this helps other developers that got the same problem as I got.
- infograf768
- Joomla! Engineer
- Posts: 366
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: •Translation Matters•
Re: Changing Site Language "on-the-fly"
Are you talking about a system plugin and a module?
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
Qui vult dare parva non debet magna rogare.
Re: Changing Site Language "on-the-fly"
Hi "Infograf",
No it's not a module or plugin. It's the main /index.php file that needs to be changed for this, and it needs to be changed on that file because on the template index.php file the JAplication is already being used and we can't change that on that part.
Maybe someone will transform it to a plugin
Regards,
BF
No it's not a module or plugin. It's the main /index.php file that needs to be changed for this, and it needs to be changed on that file because on the template index.php file the JAplication is already being used and we can't change that on that part.
Maybe someone will transform it to a plugin
Regards,
BF
- infograf768
- Joomla! Engineer
- Posts: 366
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: •Translation Matters•
Re: Changing Site Language "on-the-fly"
A system plugin would let you, I guess, use the "afterInitialize".
And a module specify the variable.
And a module specify the variable.
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
Qui vult dare parva non debet magna rogare.