aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-03-13 15:00:26 +0100
committerGitHub <noreply@github.com>2017-03-13 15:00:26 +0100
commit308e8bb5ecbc54759f10b132442065cdabf26610 (patch)
treee591a7ee001c2836df486b0fbc8415c76f9c46d6
parent938f4321137248771ed6a1163e878dda753d3fa5 (diff)
parentfbd2dd49b6a16a786c6d6da13e8065037577b7c4 (diff)
downloadnextcloud-server-308e8bb5ecbc54759f10b132442065cdabf26610.tar.gz
nextcloud-server-308e8bb5ecbc54759f10b132442065cdabf26610.zip
Merge pull request #3814 from nextcloud/oc-27328-delay-language-initialisation
use closure to properly defer l10n initialization (#27328)
-rw-r--r--apps/federatedfilesharing/appinfo/app.php4
-rw-r--r--apps/files_external/appinfo/app.php19
-rw-r--r--apps/files_sharing/appinfo/app.php60
-rw-r--r--apps/files_trashbin/appinfo/app.php21
-rw-r--r--apps/systemtags/appinfo/app.php14
5 files changed, 59 insertions, 59 deletions
diff --git a/apps/federatedfilesharing/appinfo/app.php b/apps/federatedfilesharing/appinfo/app.php
index 4a5492b0f15..b6a145bcc2c 100644
--- a/apps/federatedfilesharing/appinfo/app.php
+++ b/apps/federatedfilesharing/appinfo/app.php
@@ -24,7 +24,6 @@
use OCA\FederatedFileSharing\Notifier;
$app = new \OCA\FederatedFileSharing\AppInfo\Application();
-$l = \OC::$server->getL10N('files_sharing');
$eventDispatcher = \OC::$server->getEventDispatcher();
$app->registerSettings();
@@ -32,7 +31,8 @@ $app->registerSettings();
$manager = \OC::$server->getNotificationManager();
$manager->registerNotifier(function() {
return \OC::$server->query(Notifier::class);
-}, function() use ($l) {
+}, function() {
+ $l = \OC::$server->getL10N('files_sharing');
return [
'id' => 'files_sharing',
'name' => $l->t('Federated sharing'),
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 3a90cf0c2c1..925596198cf 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -37,15 +37,16 @@ $appContainer = \OC_Mount_Config::$app->getContainer();
\OC_Mount_Config::$app->registerSettings();
-$l = \OC::$server->getL10N('files_external');
-
-\OCA\Files\App::getNavigationManager()->add([
- "id" => 'extstoragemounts',
- "appname" => 'files_external',
- "script" => 'list.php',
- "order" => 30,
- "name" => $l->t('External storage')
-]);
+\OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('files_external');
+ return [
+ 'id' => 'extstoragemounts',
+ 'appname' => 'files_external',
+ 'script' => 'list.php',
+ 'order' => 30,
+ 'name' => $l->t('External storage'),
+ ];
+});
$mountProvider = $appContainer->query('OCA\Files_External\Config\ConfigAdapter');
\OC::$server->getMountProviderCollection()->registerProvider($mountProvider);
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index 4fed51b1194..8228e761592 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -26,8 +26,6 @@
*
*/
-$l = \OC::$server->getL10N('files_sharing');
-
\OCA\Files_Sharing\Helper::registerHooks();
\OCP\Share::registerBackend('file', 'OCA\Files_Sharing\ShareBackend\File');
@@ -52,39 +50,41 @@ $eventDispatcher->addListener(
$config = \OC::$server->getConfig();
if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
-
- \OCA\Files\App::getNavigationManager()->add(
- array(
- "id" => 'sharingin',
- "appname" => 'files_sharing',
- "script" => 'list.php',
- "order" => 10,
- "name" => $l->t('Shared with you')
- )
- );
+ \OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('files_sharing');
+ return [
+ 'id' => 'sharingin',
+ 'appname' => 'files_sharing',
+ 'script' => 'list.php',
+ 'order' => 10,
+ 'name' => $l->t('Shared with you'),
+ ];
+ });
if (\OCP\Util::isSharingDisabledForUser() === false) {
+ \OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('files_sharing');
+ return [
+ 'id' => 'sharingout',
+ 'appname' => 'files_sharing',
+ 'script' => 'list.php',
+ 'order' => 15,
+ 'name' => $l->t('Shared with others'),
+ ];
+ });
- \OCA\Files\App::getNavigationManager()->add(
- array(
- "id" => 'sharingout',
- "appname" => 'files_sharing',
- "script" => 'list.php',
- "order" => 15,
- "name" => $l->t('Shared with others')
- )
- );
// Check if sharing by link is enabled
if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {
- \OCA\Files\App::getNavigationManager()->add(
- array(
- "id" => 'sharinglinks',
- "appname" => 'files_sharing',
- "script" => 'list.php',
- "order" => 20,
- "name" => $l->t('Shared by link')
- )
- );
+ \OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('files_sharing');
+ return [
+ 'id' => 'sharinglinks',
+ 'appname' => 'files_sharing',
+ 'script' => 'list.php',
+ 'order' => 20,
+ 'name' => $l->t('Shared by link'),
+ ];
+ });
}
}
}
diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php
index ed53657d22a..d4e44b78850 100644
--- a/apps/files_trashbin/appinfo/app.php
+++ b/apps/files_trashbin/appinfo/app.php
@@ -25,17 +25,16 @@
*
*/
-$l = \OC::$server->getL10N('files_trashbin');
-
// register hooks
\OCA\Files_Trashbin\Trashbin::registerHooks();
-\OCA\Files\App::getNavigationManager()->add(
-array(
- "id" => 'trashbin',
- "appname" => 'files_trashbin',
- "script" => 'list.php',
- "order" => 50,
- "name" => $l->t('Deleted files')
-)
-);
+\OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('files_trashbin');
+ return [
+ 'id' => 'trashbin',
+ 'appname' => 'files_trashbin',
+ 'script' => 'list.php',
+ 'order' => 50,
+ 'name' => $l->t('Deleted files'),
+ ];
+});
diff --git a/apps/systemtags/appinfo/app.php b/apps/systemtags/appinfo/app.php
index 2c095753ce8..bb2930e9197 100644
--- a/apps/systemtags/appinfo/app.php
+++ b/apps/systemtags/appinfo/app.php
@@ -65,14 +65,14 @@ $mapperListener = function(MapperEvent $event) {
$eventDispatcher->addListener(MapperEvent::EVENT_ASSIGN, $mapperListener);
$eventDispatcher->addListener(MapperEvent::EVENT_UNASSIGN, $mapperListener);
-$l = \OC::$server->getL10N('systemtags');
-
-\OCA\Files\App::getNavigationManager()->add(
- array(
+\OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('systemtags');
+ return [
'id' => 'systemtagsfilter',
'appname' => 'systemtags',
'script' => 'list.php',
'order' => 25,
- 'name' => $l->t('Tags')
- )
-);
+ 'name' => $l->t('Tags'),
+ ];
+});
+