fix(config): only cache category names in the languages in use

The cache held the category names in all 96 app store languages
(about 49 KB), while an instance typically uses one or two. Keep only
English, the default language and the languages users have set, as the
two-letter codes the lookup uses; on a Dutch instance this is about
1.3 KB.

A user who switches to a language that is not cached yet sees English
names until the cache is refreshed after a week, or right away when an
admin saves the settings. The README mentions this.
This commit is contained in:
2026-09-30 13:17:37 +02:00
parent ccefefa6f7
commit 22e87e12ad
4 changed files with 30 additions and 3 deletions
+3 -1
View File
@@ -12,6 +12,7 @@ use OCA\SideMenu\Service\AppRepository;
use OCA\SideMenu\Service\CategoryRepository;
use OCA\SideMenu\Service\Color;
use OCA\SideMenu\Service\ConfigProxy;
use OCA\SideMenu\Service\LangRepository;
use OCA\Theming\ThemingDefaults;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
@@ -60,7 +61,8 @@ class Application extends App implements IBootstrap
$c->get(IFactory::class),
$c->get(IUserSession::class),
$c->get(IAppConfig::class),
$c->get(ITimeFactory::class)
$c->get(ITimeFactory::class),
$c->get(LangRepository::class)
);
});