Author Topic: com.cividesk.l10n.update gettextResourceDir  (Read 819 times)

Offline HanV

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 0
com.cividesk.l10n.update gettextResourceDir
« on: February 06, 2017, 12:13:19 am »
I have upgraded to the version 4.7.16 (Joomla, Windows10). After the upgrade I installed from github the extension l10n_update.

I get now rmessages  from l10n_update "Cannot read unrecognized property CRM_Core_Config::$gettextResourceDir."

Is this extension still in use? I have found it on github, after I read about it on the wiki as recommended for the translations. The property is used in the extension, but in the documentation it is marked als removed.
On the page the default location is <docroot>/media/civicrm/custom_ext. I think it must be <docroot>/media/civicrm/ext. That value is the default location in the application and that directory is present. But the installation of l10n_update was no problem.

Offline mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: com.cividesk.l10n.update gettextResourceDir
« Reply #1 on: April 19, 2017, 06:02:39 pm »

Replying late, but there is activity in the l10n.update issue queue (dating to 2016):

Can you test the patch and ping the issue?

CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @

Offline HanV

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 0
Re: com.cividesk.l10n.update gettextResourceDir
« Reply #2 on: May 15, 2017, 08:10:11 am »
Sorry, i do not check these responses regulary.

I removed the extension two weeks after my post.
I have installed now the old extension from github with the change of johanv

 $l10n = $config->gettextResourceDir;    =>  $l10n = CRM_Core_I18n::getResourceDir();

After testing this patch, i think it is not enough.
The check to do only once a day the update is wrong. $delay is not the number seconds in one day.
The directory creation is done if the mo-file does not exists, not if the directory does not exists. 

See in the attachement the updated function l10nupdate_download.

The extension will now try to download
(I have one single-lingual site with only Dutch)
The first file is downloaded and installed. The second file is missing, and local created empty.

The extension is very slow, if there are updates. There must be one problem with CRM_Core_Session::setStatus.
I have used this setStatus function (without  if (!empty($downloaded))) and i still get a timeout.
I think the code "Output a nicely formatted message" must be after the loop "foreach ($locales as $locale)"
But that won't solve the time-out, without the CRM_Core_Session::setStatus there is no time-out.

In the attachment my version (txt, because php is not allowed)
« Last Edit: May 15, 2017, 08:57:17 am by HanV »