[UTIL][Common][I18N] Use actor's preferred language for _m and utility to retrieve current language even when no actor is logged in

This commit is contained in:
2022-01-04 21:39:40 +00:00
parent 6247dd4c1a
commit 5a0bbfc795
4 changed files with 14 additions and 6 deletions

View File

@@ -49,7 +49,7 @@ class Feeds extends FeedController
{
$data = $this->query(
query: 'note-local:true',
language: Common::actor()?->getTopLanguage()?->getLocale(),
locale: Common::currentLanguage()->getLocale(),
);
return [
'_template' => 'collection/notes.html.twig',
@@ -67,7 +67,7 @@ class Feeds extends FeedController
$actor = $user->getActor();
$data = $this->query(
query: 'note-from:subscribed-person,subscribed-group,subscribed-organization,subscribed-business',
language: $actor->getTopLanguage()->getLocale(),
locale: Common::currentLanguage()->getLocale(),
actor: $actor,
);
return [