Components
| JPromoter |
| JContentSubscription |
| JDefender |
| JUser |
Best Partners
| Components for Joomla1.5 |
| Best Joomla Hosting |
| Pixelsparadise Templates |
| Joomla Directory |
| Joomla Review Component |
| Webmaster-Tips - Joomla! |
We Recommend
| JoomStyle Templates |
JoomlaEquipment Becomes Free of Charge!
Now as soon the components not commercial anymore we will give guarantee support only for paid users in priority. Please if you are paid user send support request from the Ask Help form, other emails we will not check for support, just for information. Also note you will need include your order number in request.
Tutorials
Development tips and tricks
Joomla 1.5 auto creation of Language file
| Joomla 1.5 auto creation of Language file |
| Thursday, 18 January 2007 | |
|
It is not very pleasant either keep entering new items in language file or later look through all the code and compile it to lang file. That is nice system to store languages in UTF8 in en-GB.com_mycomponent.ini file. I think that is smart enough and can make Joomla internalization simple. So as I am quite lazy so I thought of way of automatic language file creation. First thing you will need to do is create your own text class. And it is actually the best development practice. Let's say
Place it before you ever use JText::_(‘str'). Then do butch replace and replace all ‘JText::_(‘ to 'myText::_(' in all php files of your project. Also after that use only this class to display the text. Now everything should work the same way. The only thing is that you now can process any text before it is displayed. I think that most of you already guessed what else is needed to be done. But I have still one suggestion. Do not process text exactly to en-GB.com_mycomponent.ini. Save it to lang.txt and later revise it and update en-GB.com_mycomponent.ini. Here is the full code I use for that but you can develop better code. And if you do please, send it to me and I'll update it here.
Comments (9)
![]() dfh dfghdfhdghfhdf dfgh dghdhdfgh
written by fghdfghdf, December 12, 2007
ugfy rt ertdgdfbg dfghdfgh dfghdfghd d dfgh dfghdfghdfh dfhgdfg df dfh
... written by baby, November 08, 2008
http://www.wow-powerleveling-wow.com/
http://www.powerleveling-wowgold.com/ Write comment
|
|
| Last Updated ( Friday, 16 March 2007 ) |
| < Prev | Next > |
|---|

