Joomla

Language issues after upgrading to Joomla 3.7

Are you facing language issues after upgrading to Joomla 3.7 ? Some of the translation packs for Joomla and the third party extensions might not work in Joomla 3.7 due to a change introduced in the latest Joomla version.

You might see either your backend or frontend of the site not translated, especially when you are running a multi-lingual site. It is possible that a few pages of the site (specific to a third party extension) might not be translated and showing in English.

Well, the problem is with the language / translation file.  Wondering why the same language files worked till Joomla 3.6.5 and the same are not in Joomla 3.7 ? Read on.

What is causing the problem

Till Joomla 3.6.5, the following code has been used to parse the language files in libraries/joomla/language/language.php

This has been changed in Joomla 3.7. The language file parser has been updated to use the PHP parse_ini_file function.

$strings = @parse_ini_file($filename);
 

The function will raise an error if invalid syntax is detected. As a result the file will not be loaded. Even if your turn on the language debug option, you wont see it reporting any errors. (Not sure about the purpose of this option now. Because it is not going to throw any errors. It will just say the file is not loaded )

Hence you would see untranslated strings or the default English text in your website.

Another valid point to note here is that: If the parse_ini_file function is disabled in your PHP.ini (read as your hosting service), the you would see untranslated strings everywhere.

What is the solution ?

You will have to find out the invalid syntax in the language file and fix those invalid strings. That is the permanent solution.

Ok. I now hear the frustration from the non-technical users. Unless your third party extension developer or the language maintainer corrected the issue, it will be very difficult for a normal Joomla user to spot the issues and fix it.

The instructions provided at the Joomla's documentation asks us to run a command line check or a PHP script. But that might not be possible for everyone.

So how do i fix it ?

Here are the solutions available.

First, make sure if the parse_ini_file function is NOT disabled before you attempt any of the following solutions.

Go to Joomla administrator -> System -> System Information -> PHP settings.

Check the Disabled functions. If it is disabled, contact your hosting service to enable it for you

1. Common invalid syntax that cause the error

Go to Joomla administrator -> System Turn on the Language debugger. Look at the debug console and note down the files that are NOT LOADING. Open the language files and look for these common issues

a. Unclosed double quotes

This is the most common issue. Use a text editor like Atom, SublimeText to find out the unclosed ones and close them.

b. Double backslashes

If the translation is managed in transifex, then a translator probably used a backslash for escaping single or double quotes in the values. Example:

"You have \"NOT\" selected any option"
When building this translation using tools like CTTransifex, this automatically becomes
"You have \\"_QQ_"NOT\\"_QQ_" selected any option"
This is not a valid syntax. Search for double backslashes and remove them

2. Still the issue is not solved ?

This is a bit tricky step. Use this PHP script to debug your language file.

NOTE: You should know which file is causing the issue. And you can note that down by looking at the Language debug output

3. My site is in production and I cannot afford a longer downtime. Is there any quick fix?

Yes. There is. You can go back to the way it is handled in Joomla 3.6.5. But this is not recommended any way.

Take a full backup of the site.

Edit libraries/joomla/language/language.php

Around 833, you will find

$strings = @parse_ini_file($filename);

Change this to

 

Save. Hope this helps you resolve the issues. If you find any other workarounds or solutions, please comment below.
Subscribe to get updates from us