Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For your component to be multilingual you need to define languages files which are stored in the <code>language</code> folder in both the administrator and public side of the website. These language files are <code>.ini</code> files which should be defined for every language you want to include. So if you do english and dutch your files <code>.ini</code> files should be in:</p> <p><code>/language/en-GB/en-GB.com_yourcom.ini</code></p> <p><code>/language/nl-NL/nl-NL.com_yourcom.ini</code></p> <p>Then every string should be passed to the translator method <code>_()</code> (yes that's an underscore) in the <code>JText</code> class like so:</p> <p><code>JText::_("COM_YOURCOM_STRING")</code> where <code>COM_YOURCOM_STRING</code> is simply a string in your component. </p> <p>I recommend using short string descriptions if the string you are translating is a large block of text.</p> <p>EDIT: For your specific case I would add a column <code>translation_id</code> to your table where the items are stored. Then create a new table with 3 (or 4) columns where the translations are stored:</p> <p><code>id, item_id, (language), translation</code></p> <p>In your component xml you could add an entry which generates a dropdown to define what language your item is in. If it's anything other than the default language, it should create a new entry in the translations table.</p> <p>I would also suggest to take a look how Joomla! manages languages internally and also how Joomfish works!</p> <p>Good resources:</p> <p><a href="http://docs.joomla.org/Embedding_translatable_strings_in_the_template" rel="nofollow">http://docs.joomla.org/Embedding_translatable_strings_in_the_template</a></p> <p><a href="http://docs.joomla.org/Specification_of_language_files" rel="nofollow">http://docs.joomla.org/Specification_of_language_files</a></p> <p><a href="http://docs.joomla.org/Language_Guidelines_for_3rd_Party_Extensions" rel="nofollow">http://docs.joomla.org/Language_Guidelines_for_3rd_Party_Extensions</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload