How To Use Joomla! Language Overrides

A client of ours recently asked me to change the Joomla's response when a visitor submits a message on the Contact Us form. By default Joomla replies, "Thank you for your email." The client simply wanted to add, "We'll contact you soon." Fortunately, Joomla! now supports language overrides, making this a very simple process.

Joomla! Language Support and Overrides

In the Joomla! 1.5 days, you'd have to hack the Contacts language file. The problem with that is you run the risk of losing your changes any time you do an update on Joomla! Now, things are bit simpler... Joomla now supports something called Language Overrides. Overrides give us the ability to change any standard wording without worrying about losing the changes during updates.

So, how do you use language overrides?

It's pretty straightforward using Joomla's Language Edit Overrides. To get there:

  • Pull down the Extensions Menu
  • Select the Language Manager
  • Click the Overrides Tab
  • Click the New Button on the Icon bar

Now that we're here, we have to find the language string. The easiest way to do it is to search for the text that we want to change. In this case, "Thank you for your email."

  • In the search box on the right enter the phrase: Thank you for your email.
  • Select the Value radio button.
  • Click the Search button.

At the bottom, Joomla shows the Search Results box, and tells us that the language constant is COM_CONTACT_EMAIL_THANKS. Now let's change it.

  • Click the language constant we've found, COM_CONTACT_EMAIL_THANKS and Joomla will fill in the boxes on the left with the current values.
  • Edit the Text box on the left to read as you'd like. In our client's case, that would be: Thank you for your email. We'll contact you soon.
  • Click the Save & Close button on the Icon bar.

Joomla now shows the language constant and replacement Text, as well as the language tag. Clear your cache, and Joomla will show our new override text when visitors submit a form.

If you're a bit more technical, or have a large number of overrides to create you can edit the language override file directly. Use whatever File Manager your webhost offers through their control panel. Or, if you're a geek like me, jump to the Linux command line and edit the file with nano or vi.

Here's how it's done:

  • Find the language string that Joomla! is looking for.
    • With your Webhost's File Manager, browse to your local language directory. In my client's case that was [joomla-root]\language\en-GB\.
    • Find the component's language file. In my case that is en-GB.com_contacts.ini.
    • View the file - there should be a view or edit option in your webhost's file manager.
    • Search for the text you want to change. In this case it was, Thank you for your email.
    • Look to the left, and note the Joomla language string. Here it was, COM_CONTACT_EMAIL_THANKS
  • Create your language override
    • Edit (or create) the override file for your language. In my client's case that was [joomla root]\language\overrides\en-GB.override.ini. You can substitute any country and language code you need, but the file name will always be xx-XX.override.ini.
    • Go to the end of the file and add the language string, followed by =, followed by the words you WANT to appear (in quotes). For my client I added:
COM_CONTACT_EMAIL_THANKS="Thank you for your email - we'll contact you shortly."

Save the language override file and voila, the contact us form returns the new phrase. Nice and easy in Joomla 1.6/1.7/2.5!