Edit Language Files

Added by Michael Liebler over 7 years ago

Some of the newly created components fields will have incomprehensible labels.

Yacc creates the language files in the folders language and admininstrator/language.

Where to find the stuff

You can regognize the text in your php files by the function JText::_();

1JText::_('some stuff');

Other places to look for are the xml files in models/forms.

How to translate

In the example component we should change the label in_stock to In stock.

Open administrator/en-GB.com_book.ini in your editor and write:

IN_STOCK=In stock

Thats all.

But it's better to use a namespace like COM_BOOK. May be you want to change in_stock in the book.xml (models/forms) to COM_BOOK_IN_STOCK.

Menu Items

A special case is the text to be displayed when you create an item in the Menu Manager. The source is found in the frontend views.

Check the file components/com_book/views/book/tmpl/default.xml:

<description>Book Layout_DESC</description>

You have to create administrator/language/de-DE/de-DE.com_book.menu.ini and to translate it there.

The use of the component specific namespace is required here:

COM_BOOK.BOOK_DESC=This Layout will show a single book

Notice: Language files must be utf8 encoded.