4

What can be the reason for not being able to install languages through admin?
I am getting:

There are no available languages to install at the moment. Please select the "Find languages" button to check for updates on the Joomla! Languages server. You will need an internet connection for this to work.

I have cleared caches, and certainly I have internet connection.

  • Joomla 3.5.1

Update

Based on Lodder's answer, below:

All my update sites are enabled in the admin.
However the findLanguages() method has a different opinion:
Modifying it a little as below, the results I am getting from the 2 if statements are: 1 & 2 accordingly.

public function findLanguages($cache_timeout = 0)
{
    if (!$this->enableUpdateSite())
    {
        var_dump('1');
        //return false;
    }else {
        var_dump('2');
    }
    // *** This results to var_dump 1 ***

    if (!$this->enGbExtensionId)
    {
        var_dump('1');
        //return false;
    }else {
        var_dump('2');
    }
    // *** This results to var_dump 2 ***
2

I didn't spend more time to find the cause and the fix of this issue back then, but today I had to work on a site with the same issue: No Languages Available on the Languages Manager and a requirement by the site owner to fix this.

So after going round around, I discovered that for this new particularly website the issue was in the database.

In order for the Language Installer to find Languages packs, there must be the following records in the database:

  • Table: #__extensions
    A package type extension with name: English (en-GB) Language Pack

  • Table: #__update_sites
    A record for this site: Name: Accredited Joomla! Translations, Type: collection, Location: https://update.joomla.org/language/translationlist_3.xml

  • Table: #__update_sites_extensions
    A record that will join the extension from first table with the update site from the second table. So this record should have the id of the English (en-GB) Language Pack extension, and the id of Accredited Joomla! Translations update site.

In my case it was the English (en-GB) Language Pack package extension missing from the extensions tables at first place. Not sure how this happened initially, since this package is also a protected extension, but that was the fact.

So I had to add the extension in the database:

INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`)
VALUES
    ('English (en-GB) Language Pack', 'package', 'pkg_en-GB', '', 0, 1, 1, 1, '{\"name\":\"English (en-GB) Language Pack\",\"type\":\"package\",\"creationDate\":\"December 2016\",\"author\":\"Joomla! Project\",\"copyright\":\"Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.\",\"authorEmail\":\"admin@joomla.org\",\"authorUrl\":\"www.joomla.org\",\"version\":\"3.6.5.1\",\"description\":\"en-GB language pack\",\"group\":\"\",\"filename\":\"pkg_en-GB\"}', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);

After adding the extension, I found out that the only other thing I had to, was to go into the Extensions: Update Sites and Rebuild the Update Sites. This is taking care of the rest, that is adding the Update Site and join the 2 records.

After that Languages became available for installation in the Language Installer in the backend.

1

This is a long shot, by try going to:

Extensions >> Manage >> Update Sites

Ensure the core Joomla update sites are enabled.

If they are already enabled, then (and this is not a fix but a test), go to line 237 of:

administrator\components\com_installer\models\languages.php

and add:

var_dump('test');

just before the return false;

Then try to find languages again. If you see test being dumped, then let me know and I'll look at that further

  • Well, all update sites are enabled, but the if (!$this->enableUpdateSite()) returns true and it stops there. If I comment out the return false of this if condition, your var_dump('test') won't come out. But also still it won't find any languages. – FFrewin May 12 '16 at 11:18
  • Did you put the var_dump inside the if (!$this->enGbExtensionId) { } statement? If the enableUpdateSite() is returning true, then the update sites are fine and working as expected. So it could be the enGbExtensionId() function. – Lodder May 12 '16 at 11:24
  • Try this if (!$this->enGbExtensionId) { die('test'); } – Lodder May 12 '16 at 11:26
  • It is the !$this->enableUpdateSite() that returns true, which means update sites are not fine. I updated my answer, including the modified code of the findLanguages method and the results I am getting. – FFrewin May 12 '16 at 12:48
  • I found the solution - check the answer posted. – FFrewin Jan 31 '17 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.