autoload app's js translations
This commit is contained in:
parent
f846d1e3f1
commit
717e3acd9b
|
@ -10,6 +10,7 @@ class OC_Util {
|
||||||
public static $headers = array();
|
public static $headers = array();
|
||||||
private static $rootMounted = false;
|
private static $rootMounted = false;
|
||||||
private static $fsSetup = false;
|
private static $fsSetup = false;
|
||||||
|
private static $loadedScriptTranslations = array();
|
||||||
|
|
||||||
private static function initLocalStorageRootFS() {
|
private static function initLocalStorageRootFS() {
|
||||||
// mount local file backend as root
|
// mount local file backend as root
|
||||||
|
@ -362,6 +363,12 @@ class OC_Util {
|
||||||
public static function addScript($application, $file = null) {
|
public static function addScript($application, $file = null) {
|
||||||
$path = OC_Util::generatePath($application, 'js', $file);
|
$path = OC_Util::generatePath($application, 'js', $file);
|
||||||
if (!in_array($path, self::$scripts)) {
|
if (!in_array($path, self::$scripts)) {
|
||||||
|
// load javascript translations if it is the first time an app's
|
||||||
|
// script is loaded.
|
||||||
|
if (!in_array($application, self::$loadedScriptTranslations)) {
|
||||||
|
self::addTranslations($application);
|
||||||
|
self::$loadedScriptTranslations[] = $application;
|
||||||
|
}
|
||||||
self::$scripts[] = $path;
|
self::$scripts[] = $path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue