fix translations

This commit is contained in:
Simon Vieille 2020-08-13 11:21:06 +02:00
commit ef72c00fbb
Signed by untrusted user: deblan
GPG key ID: 03383D15A1D31745
127 changed files with 819 additions and 22 deletions

View file

@ -2,7 +2,8 @@
namespace OCA\SideMenu\Service;
use \OC_App;
use OC_App;
use OCP\L10N\IFactory;
/**
* class AppRepository.
@ -16,12 +17,18 @@ class AppRepository
*/
protected $ocApp;
/**
* @var IFactory
*/
protected $l10nFactory;
/**
* @param OC_App $ocApp
*/
public function __construct(OC_App $ocApp)
public function __construct(OC_App $ocApp, IFactory $l10nFactory)
{
$this->ocApp = $ocApp;
$this->l10nFactory = $l10nFactory;
}
/**
@ -39,6 +46,8 @@ class AppRepository
$id = $app['id'];
if (isset($navigation[$id])) {
$app['name'] = $this->l10nFactory->get($app['id'])->t($app['name']);
$visibleApps[$id] = $app;
}
}
@ -47,7 +56,7 @@ class AppRepository
if (substr($app['id'], 0, 14) === 'external_index') {
$visibleApps[$app['id']] = [
'id' => $app['id'],
'name' => $app['name'],
'name' => $this->l10nFactory->get($app['id'])->t($app['name']),
'preview' => $app['icon'],
'previewAsIcon' => true,
'category' => [
@ -57,7 +66,7 @@ class AppRepository
} elseif ($app['id'] === 'files') {
$visibleApps[$app['id']] = [
'id' => $app['id'],
'name' => $app['name'],
'name' => $this->l10nFactory->get($app['id'])->t($app['name']),
'preview' => $app['icon'],
'previewAsIcon' => true,
'category' => [],