fix translations

This commit is contained in:
Simon Vieille
2020-08-13 11:21:06 +02:00
parent e1c6784d41
commit ef72c00fbb
127 changed files with 819 additions and 22 deletions
+3 -9
View File
@@ -42,11 +42,6 @@ class NavController extends Controller
*/
protected $appRepository;
/**
* @var IL10N
*/
protected $trans;
/**
* @var IFactory
*/
@@ -72,8 +67,8 @@ class NavController extends Controller
AppRepository $appRepository,
CategoryFetcher $categoryFetcher,
URLGenerator $router,
IFactory $l10nFactory,
IL10N $trans)
IL10N $trans,
IFactory $l10nFactory)
{
parent::__construct($appName, $request);
@@ -82,7 +77,6 @@ class NavController extends Controller
$this->categoryFetcher = $categoryFetcher;
$this->l10nFactory = $l10nFactory;
$this->router = $router;
$this->trans = $trans;
}
/**
@@ -122,7 +116,7 @@ class NavController extends Controller
unset($categoriesLabels[$k]);
}
$categoriesLabels['external_links'] = $this->trans->t('External sites');
$categoriesLabels['external_links'] = $this->l10nFactory->get('external')->t('External sites');
$items['other'] = [
'name' => '',
+13 -4
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' => [],