Page 1 of 1

storing translations

Posted: Mon Apr 09, 2007 1:58 pm
by cold
-translations for different languages are stored in .ini files.
-the choosen language is stored in a $_session['lang'] variable.
-for every file accessed i load the .ini file representing the $_session['lang'] and store it in the _strings() array.and use those strings for substitution.

The Question: is it better if i store the translated text once in a similar $_session variable for use during the whole session.or better to create a new instance of the i18n class and reload the .ini translation file for every new page the user access?

Posted: Mon Apr 09, 2007 2:16 pm
by Weirdan
The 'better' is a vague word. Personally I would not store such data into session.

Performance-wise it would be best to store the data into ini files and cache it in a shared memory segment on the first load.