Language support

Many times, the original English language of SimpleCaddy is not enough. You will want to translate it to your own language. Joomla provides a simple way for this, but with some rules attached.

First let’s locate the different language files.

  • Front end component: /language/en-GB/en-GB.com_simplecaddy.ini
  • Plugins (any plugins): /administrator/language/en-GB/en-GB.plg_content_simplecaddy.ini (for the core SimpleCaddy plugin)
  • Admin component: /administrator/language/en-GB/en-GB.com_simplecaddy.ini

 

Other plugins will have different file names, but all should include the sc_ or _simplecaddy part in their name and should be easy to spot.

Now let’s take a look at how those files are created.

; @package SimpleCaddy 2.0 for Joomla 2.5
; @copyright Copyright (C) 2006-2011 Henk von Pickartz. All rights reserved.
; Note : All ini files need to be saved as UTF-8 - No BOM

SC_ADDRESS="Address"
SC_ADD_TO_CART="Add to \n cart"
SC_ARTICLES_IN_CART="Article(s) currently in your cart:<br />"
SC_AVAILABLE_QTY="Available quantity"
SC_CART_EMPTY="Your cart is empty"
SC_CHANGE="Change"
SC_CITY="City"
SC_CODE="Code"
SC_CONFIGURATION="Configuration"
SC_CONFIRM="Confirm"

The header contains some information on how to create the file, as well as your copyright and the use of the file. Next, the strings to be translated.

The left part must not be touched, these are used internally to fetch the translation. Your part is on the right side of the = sign.

Between quotes “ “ is the string you want to see on your site. Some strings can be broken into multiple lines by a \n if you desire.

Now it’s time to let the brain work and translate everything in all the SimpleCaddy files.

You will need to use a decent text editor for this. Windows Notepad, MS Word and other programs will NOT do for this. What you need is a text editor capable of defining the character set of the file as well as save text without invisible control characters like MS Office/Word. I recommend TextPad for this as it is a free (more or less) program and does this particularly well. See http://textpad.com for the program and how to download.

Save the files in the UTF8 format. I cannot stress this enough as any other format like the standard (by default) ASCII format will not work.

Name the file according to your language in Joomla, for example ru-RU.com_simplecaddy.ini or nl-NL.com_simplecaddy.ini.

Now that you have saved your file on your computer, upload it to the correct folder on your server, see the beginning of this post.

Troubleshooting

If the translation does not work, there may be multiple causes for this. The most frequent cause is the encoding of the file. Check again that the file is saved as UTF8 or UTF-8.

Another frequent cause is that somewhere in the file a quote is missing. That will cause the loading of the file to fail.

To determine where you problem is go to the admin part of the site, Global Configuration and check the System tab. There set the debug system and debug langugae to yes like this:

image

If your display looks somewhat like this

image

You have a problem. Even more if you know that you have translated all those strings!

So scroll down to see what Joomla has to say about your file.

image

Ok, that looks scary. But click on that red line to see what is really going on.

image

And clearly enough, there is a problem in the file:

image

For this example I removed the closing quote from line 5. Put it back and the language file is ready to be used (or ready to show the next error.

Use this method for each language file you want to translate and everything will go fine.

This, of course goes for any language file, you can apply this to any component, plugin or module that is used in Joomla, not only SimpleCaddy.

Happy translating!