Tutorials, reviews, case studies and other tips to help website owners and website developers master the Joomla content management system.
Joomla language files
Ever wondered how to change the text that appears on your website when you perform certain Joomla functions, such as displaying a user contact form or a login module? The core Joomla text that is used to display this information is contained in language files that are included with the default installation of Joomla. Also, most extension providers use language files to display text when a module is published using their components.
Why would I want to do this?
The main benefit of using these language files is that they provide some standardization throughout your website, and once you become comfortable with using these files, you can update this text across your website.
The other great advantage of using these files is that you can display your website, not including the main article copy of course, in multiple languages as long as you have the correct files installed. There are extensions available for you to use, such as Joom!Fish, that can provide your visitors with the option of changing to their native language by clicking a link. This is becoming more popular as our audiences grow more global.
So how is this done?
If your site is in English, then the files are found under your main web directory at (web-root)/language/en-GB. You can work directly with these files through your hosting control panel if you're comfortable doing that, or you can use your favorite FTP program to access the files.
Once you've located and grabbed the file(s) you want to work with, make sure to create a backup copy before you edit anything. This way, if you mess something up badly, you can always just revert quickly back to the original. Determining which file to modify requires a bit of knowledge of Joomla and the extensions installed on your site. You also should realize that these files control the default text for both the front end display as well as the back end Administrator. Make sure you are modifying the correct lines.
Here are a couple of guidelines to help:
If the text you'd like to modify is within a component, then look for something such as "en-GB.com_" followed by the name of the component. For example, many people like to change the text that appears on various Joomla registration pages. This text is found in en-GB.com_users.ini. You will also see files with .mod_ in the filename, and these refer to module language files.
We'll update three lines that most of us are familiar with on any Joomla login module. The "forgot your password," "forgot your username," and "create an account" links show up every time you display the default Joomla login module. To update them, find the file highlighted below. It'll be in the same directory mentioned above: (web-root)/language/en-GB/en-GB.mod_login.ini.
Download or access the file and open it in a plain text editor on your local system or your hosting control panel might include a code editor.
Again, make a backup of the file. This can't be recommended strongly enough.
Search for the current text and replace it with your preferred text. Below we are looking at the three lines we want to change. Remember, these lines provide links to perform certain functions, so if you modify them make sure the function is still perfectly clear. You will see the constant value on the left, MOD_LOGIN_REGISTER for example, and then the text you want to modify in quotations on the right.
You can include HTML code if appropriate, for instance if you need some formatting for bold, underline or colored text.
Save the file, upload it if you are working over FTP, and test on the front end.
You should see your changes exactly how you placed them in the file; however, if something went wrong, just upload the backup language file you made earlier and have another go.
Incidentally, if you are looking for a language file, go to here.
The current first listing is very interesting for Australian and US websites. Have a look at what it mentions regarding Bing and geo locations.
This is yet another way to customize your Joomla website and add a little personality. Make sure to check out all of our tutorials for many more tips and tricks to increase your site's functionality and make it stand out from the crowd.