Changing Text in Joomla 3.1 using Language Overrides
In our last tutorial, we gave you a brief introduction about Joomla 3.0 language files. If you remember, there are three basic things involved:
- Language (such as English or Spanish)
- Constant (such as COM_CONTENT_WRITTEN_BY)
- Value (such as Written by or Excrito por)
Can I modify standard text in Joomla?
What if you didn't want it to say, Written by? What if instead you wanted it to read, Article author?
You could edit the language file and change Written by to Article author, but if you upgraded Joomla, you run the risk of losing those changes if any of the language files get overwritten.
Joomla 3.0 includes a feature called Language Overrides. Using language overrides allows you to change the Value (Written By) of a Constant (COM_CONTENT_WRITTEN_BY) without editing any Language Files (language/en-GB/en-GB.com_content.ini).
Using Language Overrides in Joomla 3.0
In the following steps, we'll show you how to use language overrides. We will change Written by to Article Author.
- Log into your Joomla 3.0 Admin Dashboard
- In the top menu, click Extensions and then click Language Manager
- In the left menu, click Overrides
- In the top left of the page, click New
- Find the Constant or Value to change
Under Search text you want to change and next to Search for choose Value. Then, type in the text you want to change (Written by in our example) and click Search.
Under Search Results, click on the only result. This will automatically fill in the details for you under Create a New Override.
- Change the Text
Under Create a new Override and next to Text, you'll see the Value. In this case it reads Written by %s. Change this to the text your prefer, in our case Article Author: %s.
- Click Save in the top left of the page and then test your results! As you can see in the screenshot to the right, the Written by text has been changed to Article Author.
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!
Working with Languages in Joomla 3
|1.||How to change your site language in Joomla 3.1|
|2.||Understanding Language Files in Joomla 3.1|
|3.||Changing Text in Joomla 3.1 using Language Overrides|
2014-06-05 12:21 pm
thanks, its help to translation in urdu (pakstani) language. Arabic to Urdu because urdu translation pakage is not availabel.
2014-09-26 4:56 pm
when i try to search for an existing constant like PLG_SYS_EPRIVACY_MESSAGE - or a value I know exists (extension is active and working) it returns no results. Maybe the search function doesn't search plugins constants starting PLG_ and only searches MOD's and COM's and so on?
2014-09-26 5:06 pm
Thanks for the question. The tutorial above demonstrates that the function is used to search for text within the Joomla site presented on the web. It's not used to search for code, like the plugin code or values. If you have text that's appearing on the Joomla site, this function can be used to search and override it.
I hope that helps to clear up the issue. Please let us know if you have any further questions.
2014-09-26 5:27 pm
Well it's a production site I am search on and the plugin is active and the text does show on the site. I have seached for a common string and although I got over 100 results there were no constants returned with prefix PLG_ - only JLIB_ TPL_ JLIB_ PHPMAILER_ JERROR_ JGLOBAL_ COM_ FILES which makes me think plugins are not being included in the search? :/
2014-09-26 5:44 pm
That is very likely correct. If you are unable to replace text that's being generated through a plugin, then you may need to look at the plugin itself to have that text changed. The example shown in the screenshots above is the best way I can think of to define how this particular function works. It's basically looking for a constant text string and then replacing it with the text string that you specify.
Sorry if our answer is unhelpful for your particular issue. You may want to contact the plugin's author if you are trying to change its output.