Macrotone Blogs

Macrotone blogs upon Joomla, our products and other matters.
Font size: +

Joomla 2.5 Language overrides

b2ap3 icon joomlaI was recently asked a question about language templates and how custom changes made by a site would be over ridden on a component update. This got me thinking and it seems that Joomla already provides a convenient way to create language overrides.  I am not talking about language overrides just specific strings being used instead of the standard supplied text.

This can all be done in the Joomla administrator.

First open the language override menu in Joomla admin. The menu is located under Extensions > Language Manager, under the tab Overrides. This presents a simple interface where one can filter, choose a language file for the admin or front-end, and a table list of any current overrides that are present upon the site.  If there is more than one language installed then it is possible, depending upon the language which we are working upon, to select it from the drop down.

How do language overrides work

When first used Joomla will create an ‘overrides’ folder under the language folder upon the site.  It then creates a file named zz-ZZ.override.ini within that folder, where zz-ZZ is the language criteria.  i.e en-GB for an English translation.  By using this mechanism when a component or Joomla is updated the contents of this file will remain unchanged.

Overriding the default language strings

Most of the time you will want to overwrite the default language strings. The quickest way is to click on the button New, which brings you to a screen where you enter your desired string to override and the desired value.  A language string consists from two parts, a constant and a value. If we know the names and values we can insert them into the field on the left.

 

lang1

If we do not know the value we can search for the value and then change it.

lang2

 

We have specifically illustrated changing a ‘ISSUE TRACKER’ string above, and when we refresh out front end screen we can immediately see that the change has taken effect.

lang3 

Aside

For those sites that already have performed custom language translations, then it would be possible to retain these changes by copying the changes directly into the overrides file itself prior to upgrading the component.  In this way one preserves the changes already made.

Summary

The use of this feature seems to be the perfect way for a site to create language overrides (and also create custom language strings). They provide the ideal way to change the existing translations or to create your own and insert them with php anywhere in the site webpages.  Now when updating Joomla or even component there is no worry about loosing your changes, because they are saved in a separate file.  It is a great addition when using template, module or component overrides.

Nested tables, MySQL and Joomla Smart Search.
Reflections on Joomla
 
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries