Override language text, the right way

More
07 Oct 2013 11:58 - 15 Sep 2014 04:08 #1 by Demis [Fox-Labs]
Demis [Fox-Labs] created the topic: Override language text, the right way
If you want to change a text which belongs to the official language files, do not hack them, or your modification will be overwritten on the next upgrade.

Open the language override menu in Joomla admin

Go to "Extensions" > "Language Manager".



Select the tab Overrides. Here you have a table of any current active overrides. Select the language you want to work with from the "Filter" drop down. For example: Language English, related to the site front-end side.
Now press the button "New" on the upper side.



If you have selected the correct filter value on the previous page, now you should see Language: "English" and Location: "Site" as shown in the picture.



As explained by Joomla itself, a language string consists of two parts: a constant and its value. The value is what you see on the front page
You have to use both the constant and the value in order to create your own override.

Suppose that we want to change or remove the string "Subscribe to". We don't know the name of the related constant, so we are going to set the search button to "Search for Value".
While entering the search field for the first time, be patient while Joomla creates a cache of the strings.



Search for "subscribe to" and see the results, which include the strings of Joomla core and third party extensions too. The strings which belong to Fox Contact, contain the prefix COM_FOXCONTACT in their constant.



So click on the item COM_FOXCONTACT_SUBSCRIBE_TO. In this way, the form will be populated with the constant and the value. Here edit the text "Subscribe to" with something you prefer, or even delete the value. Do not touch the constant.



Your modification will be active as soon as you press the "Save and Close" button.

But how does the language override work exactly? Joomla stores your overrides in separate files named en-GB.override.ini in the language/overrides folder. They won't be overwritten during upgrades. In this way, you can safely update Joomla and all your extensions without worrying about losing your changes.
The following user(s) said Thank You: pierre

Please Log in or Create an account to join the conversation.