[ENTITY][Language] Properly handle context actor language
This commit is contained in:
parent
d7a71ebe33
commit
04e6b2fb53
@ -378,7 +378,7 @@ class Actor extends Entity
|
|||||||
public function getPreferredLanguageChoices(?self $context = null): array
|
public function getPreferredLanguageChoices(?self $context = null): array
|
||||||
{
|
{
|
||||||
$id = $context?->getId() ?? $this->getId();
|
$id = $context?->getId() ?? $this->getId();
|
||||||
$key = ActorLanguage::collectionCacheKey($this); // TODO handle language context
|
$key = ActorLanguage::collectionCacheKey($this, $context);
|
||||||
$langs = Cache::getHashMap(
|
$langs = Cache::getHashMap(
|
||||||
$key,
|
$key,
|
||||||
fn () => F\reindex(
|
fn () => F\reindex(
|
||||||
|
@ -79,9 +79,9 @@ class ActorLanguage extends Entity
|
|||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
// }}} Autocode
|
// }}} Autocode
|
||||||
|
|
||||||
public static function collectionCacheKey(LocalUser|Actor $actor)
|
public static function collectionCacheKey(LocalUser|Actor $actor, ?Actor $content = null)
|
||||||
{
|
{
|
||||||
return 'actor-' . $actor->getId() . '-langs';
|
return 'actor-' . $actor->getId() . '-langs' . (!\is_null($content) ? '-cxt-' . $content->getId() : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function normalizeOrdering(LocalUser|Actor $actor)
|
public static function normalizeOrdering(LocalUser|Actor $actor)
|
||||||
|
Loading…
Reference in New Issue
Block a user