diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-14 13:34:52 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-14 13:34:52 +0100 |
commit | 717e3acd9bfa816e7ebe75c1a4d468995eba2acb (patch) | |
tree | 11eefa53a5e50f47056976bc099bab0112b2802d | |
parent | f846d1e3f17b482efa90bb408b1fdfdb0423dbe8 (diff) | |
download | nextcloud-server-717e3acd9bfa816e7ebe75c1a4d468995eba2acb.tar.gz nextcloud-server-717e3acd9bfa816e7ebe75c1a4d468995eba2acb.zip |
autoload app's js translations
-rw-r--r-- | lib/private/util.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index d2d286fc11e..2f2d7fb9ed3 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -10,6 +10,7 @@ class OC_Util { public static $headers = array(); private static $rootMounted = false; private static $fsSetup = false; + private static $loadedScriptTranslations = array(); private static function initLocalStorageRootFS() { // mount local file backend as root @@ -362,6 +363,12 @@ class OC_Util { public static function addScript($application, $file = null) { $path = OC_Util::generatePath($application, 'js', $file); 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; } } |