Joomla Tutorials and Blog Posts

Translating and Modifying Joomla's Language files using Language Overrides

This tutorial will show how to modify and/or translate Joomla's language strings.

One of our students was wondering how to make the Terms of Service text into an active link when people registered on his site. So we created this tutorial for him and will use this Terms of Service example to show you how language overrides work in Joomla 1.7.

This tutorial was created in Joomla 1.7 but the same will apply for Joomla 2.5 (which has not been released at the time of this writing).

Get a context

tutuploadsmedia_1318557225908.png

Get a context of what you're translating so that you know where to look. In this example, we will be modifying the text "Terms of Service" and making it linkable. We can make an educated guess that it's either in a Registration language file or a Profile language file. In order to enable the "Terms of Service" to appear in the Front-end, we had to use the "User - Profile" plugin in plugin Manager so that's another hint of where it's likely located.

Find the Translatable String

tutuploadsmedia_1318556868456.png

Once you have a good context, the next step is to find the translatable string. Use your host's file manager (e.g. cPanel's or Plesk's File Manager) and the go to either your administrator/language/en-GB folder or your language/en-GB folder and open up the .ini file that you assume might hold your language string. If you make a wrong guess, don't worry, keep making educated guesses and you'll find it eventually.

For the "Terms of Service" text, I'm guessing that I'll find it in the en-GB.plg_user_profile.ini

  • Note 1: If you don't have a reliable file manager then you can use an FTP program to download the file to your computer and edit it with a text editor and then re-upload it.
  • Note 2: Also, if you have any special characters (e.g. such as those used in Cyrillic languages) then it would be best to download the file and use a text editor such as notepad++ that can save the files as UTF-8 without BOM to ensure that the special characters are translated properly.
  • Note 3: If your Joomla site is set to another language rather than Great Britain English (which is the default) then navigate to that language folder instead rather than the en-GB folder.
tutuploadsmedia_1318558883142.png

Select utf-8 and click edit. If utf-8 without BOM is given as an option select it.

tutuploadsmedia_1318559129689.png

Search for your string by holding ctrl (for Macs hold command) and then clicking f (f stands for find). Then enter your string and search for it within the file. If the string is especially long, then only search for a small part of it to make it easier to find an exact match.

In our example we will search for "Terms of Service".

Success! Next we need to create a language override.

Create an Override

tutuploadsmedia_1318559516354.png

We are going to create a language override so that when we upgrade Joomla in the future, we won't lose our translations. Copy the whole line.

tutuploadsmedia_1318559625804.png

Now navigate to the language/overrides folder within the language folder (rather than the en-GB folder as we did previously). Look for en-GB.override.ini and edit it.

Note: If you're editing a text that appear within the administrator then you'd use administrator/language/overrides instead.

tutuploadsmedia_1318560568037.png

Paste within the first empty line after the comments.

Modify the String Between the Double Quotes

tutuploadsmedia_1318568197853.png

Finally we can modify the string between the double quotes. In our case we're making it linkable.

Note if your translation needs to use Double Quotes: In the image above I've circled "_QQ_" (it has double quotes around it as well) which is used to represent double quotes. Since the language string is within double quotes if we were to add another set of double quotes it wouldn't be processed correctly, so instead we can use "_QQ_" or the HTML code " to represent double quotes to make sure Joomla knows we haven't reached the end of the language string. Don't use escaped double quotes (i.e. \") as that will break in PHP 5.2.x

Success!

tutuploadsmedia_1318568527254.png

Last step is to check your front-end to make sure everything worked as it should.

Video Showing How to Translating and Modifying Joomla's Language files using Language Overrides

Comments

 
Sergey
#1 Sergey 2012-02-04 17:28

but now we have Joomla 2.5 with Language overrides
 
 
Nick
#2 Nick 2012-02-07 05:28

Hi Sergey,

Yes, and we're creating a tutorial for it this week. Sign up for our newsletter if you'd like to get it right away. :)

Kind regards,
Nick
 
 
Override
#3 Override 2012-03-21 16:49

the file en-GB.override. ini was not provided with 2.5.2 in the language/overri des/ folder

Where could I find it?

Regards,
 
 
Stephan Hodges
#4 Stephan Hodges 2012-07-07 00:29

The "correct" way to do this now (Joomla 2.5.6 as of this comment) is to use the administrator menu: "Extensions - Language Manager" and then create a new entry in the "Overrides" tab.
 
 
steve
#5 steve 2012-07-08 14:18

Thanks Stephan

We have a tutorial on that also. I've updated this blog post with a link: ostraining.com/.../...
 
 
Rob Lee
#6 Rob Lee 2013-02-05 14:20

Hi, thanks very much for this, I'd never have got to the Language Override feature by myself, but I notice that in 2.5.8 there is a separate email template already without the password. The switch for this resides in the User Manager, in the Options dialog, under Component. Thought this might be useful to some people
 
 
khanhhua
#7 khanhhua 2013-03-07 03:30

Thank you guys!
 
 
marci
#8 marci 2013-03-08 23:20

After much searching for a way to "customize" the en-GB.override. ini in Joomla 2.5, I finally found this excellent information. I am most interested in modifying the text between the double quotes which I need bold and colored. It would be so helpful if you could show and example of how to place a code for BOLD and RED for the following: COM_VIRTUEMART_ PRODUCT_SALESPR ICE_WITHOUT_TAX ="Our Price: "
Thank you!
 

Add comment


Security code
Refresh

blog-ad

Start Online Training

Members get access to all our video training. That's 1,142 training sessions in Joomla, Drupal, WordPress and Coding.

Latest Comments

The License for Our Tutorials

All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:

  • You can re-use these tutorials.
  • You can modify these tutorials.
  • You must link back to our original tutorial.
  • You can't use these tutorials commercially.

Click here to read the full license.

Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.

Copyright 2013 Open Source Training, LLC. All rights reserved.