I've made a translations class in my website and I just parse through a string for it to fetch the relevant translation.
At the moment, I have a table with the original string, and the other translations. I then make a query for each string I need translating in a webpage. The language to be translated to is already stored in the class.
<?php echo $AS_translate->('Good morning'); ?>
I'm starting to wonder if this is going to become a perfomance issue, what with processing around 40 MySQL queries just for translations.
What would be the better option? Get all the traslations for the language on pageload, then pull them back via array?
<?php echo $_AS_translate['Good Morning']; ?>
Or, something I thought of this morning which was to use ini files and forget the DB all together. I know Joomla and other big CMS applications use this method.
Can anyone offer their opinions and expertise?
Many thanks!