开发者

How to write my component for joomla with another language?

开发者 https://www.devze.com 2022-12-30 00:21 出处:网络
I writed a component for joomla I want use more than once language.Ex english & Itatly But i don\'t know how to do it.

I writed a component for joomla I want use more than once language.Ex english & Itatly But i don't know how to do it. Use component joomfish but only effect with component exsist on this joomla version, not effect with my comp开发者_如何学Pythononent ? How to config my component ?


You don't need Jomfish, Joomla has this capability inside.

You need to use JText and language files.

Step 1: Instead of echo 'Hello' use echo JText::_('COM_EXAMPLE_HELLO')

Step 2: Create a file language/en-GB/en-GB.com_example.ini

Step 3: In the ini file, enter COM_EXAMPLE_HELLO=Hello

Step 4: In the installer XML, don't forget the language ini file: http://docs.joomla.org/Components:xml_installfile


you add your selected language in main xml file and install xml file to add your language and one more simple way to create components

http://www.notwebdesign.com/joomla-component-creator/

also you u create about your requirement than you add easily multiple language ..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号