// Option: `restrict` - auto-restrict remote access
'configAndLogDir' => ['path', 'civicrm.log', ['mkdir', 'restrict']],
'templateCompileDir' => ['path', 'civicrm.compile', ['mkdir', 'restrict']],
+ 'l10nDir' => ['path', 'civicrm.l10n', ['mkdir', 'restrict']],
// "setting-path" properties are settings with special filtering
// to return normalized file paths.
* @return string
*/
public static function getResourceDir() {
- static $dir = NULL;
- if ($dir === NULL) {
- $dir = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'l10n' . DIRECTORY_SEPARATOR;
- }
- return $dir;
+ return \Civi::paths()->getPath('[civicrm.l10n]/.');
}
/**
'path' => defined('CIVICRM_TEMPLATE_COMPILEDIR') ? CIVICRM_TEMPLATE_COMPILEDIR : \Civi::paths()->getPath('[civicrm.private]/templates_c'),
];
})
+ ->register('civicrm.l10n', function () {
+ $dir = defined('CIVICRM_L10N_BASEDIR') ? CIVICRM_L10N_BASEDIR : \Civi::paths()->getPath('[civicrm.private]/l10n');
+ return [
+ 'path' => is_dir($dir) ? $dir : \Civi::paths()->getPath('[civicrm.root]/l10n'),
+ ];
+ })
->register('wp.frontend.base', function () {
return ['url' => rtrim(CIVICRM_UF_BASEURL, '/') . '/'];
})
define('CIVICRM_UF', 'Drupal');
define('CIVICRM_UF_BASEURL', '/');
+define('CIVICRM_L10N_BASEDIR', getenv('CIVICRM_L10N_BASEDIR') ? getenv('CIVICRM_L10N_BASEDIR') : __DIR__ . '/../l10n');
require_once 'CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register();