X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions changelog/unreleased/38072
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Bugfix: Pick the translations from templates included from other apps

Some apps can include template parts from a different app, normally from core.
From example, the activity app can include content from the core templates to
be used in the activity email.

The translated strings were picked from the original app even though the
template was within core space. As a result, some string weren't translated
because of the missing translation for those strings in the original app.
Note that core had the strings correctly translated.

Now the translations are picked from the requested app template as intended,
instead of looking for them in the original app.

https://github.com/owncloud/core/pull/38072
9 changes: 8 additions & 1 deletion lib/private/Template/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,14 @@ public function fetchPage($additionalParams = null) {
protected function load($file, $additionalParams = null) {
// This variables will be used inside templates, they are not unused!
$_ = $this->vars;
$l = $this->l10n;
if (isset($additionalParams['app'])) {
// in case a template wants to include content from another app (usually from core)
// we need to change the l10n object and adjust it to use the new app instead of
// the one currently set, so the translation are picked from the correct app.
$l = \OC::$server->getL10N($additionalParams['app'], $this->l10n->getLanguageCode());
} else {
$l = $this->l10n;
}
$theme = $this->themeDefaults;

if ($additionalParams !== null) {
Expand Down
X Tutup