From 827e5f86926372f2b595d55c9dcc46add5904d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baki=20Burak=20=C3=96=C4=9F=C3=BCn?= Date: Wed, 8 Apr 2026 13:50:32 +0300 Subject: [PATCH] fix: load core translations on public sharing pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PublicTemplateResponse loads core JavaScript bundles (public-page-menu, public-page-user-menu) that use runtime t('core', ...) calls for translation. However, core translations (core/l10n/.js) were never loaded because: 1. Util::addScript() skips addTranslations() when $application is 'core' 2. PublicTemplateResponse never explicitly called addTranslations('core') This caused strings like 'Set public name', 'Change public name', 'You are currently not identified.' and 'User menu' to always appear in English on public sharing pages, regardless of the configured language. Add \OCP\Util::addTranslations('core') before the addScript calls to ensure core translations are available for the JavaScript bundles. Fixes: https://github.com/nextcloud/server/issues/59501 Signed-off-by: Baki Burak Öğün --- lib/public/AppFramework/Http/Template/PublicTemplateResponse.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php index 4fb0a09efea49..3480f8edae52d 100644 --- a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php +++ b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php @@ -44,6 +44,7 @@ public function __construct( array $headers = [], ) { parent::__construct($appName, $templateName, $params, 'public', $status, $headers); + \OCP\Util::addTranslations('core'); \OCP\Util::addScript('core', 'public-page-menu'); \OCP\Util::addScript('core', 'public-page-user-menu');