UsedTranslationTranslatorCollector
class UsedTranslationTranslatorCollector implements Collector
Traits
Upstream collects only the key. The missing-translation rule resolves each lookup through the booted translator, so the call's locale, fallback and operation are collected with it.
Methods
Get the lookup made by a call with a literal translation key.
Get the locales a lookup can use, where null is the translator's current locale.
Determine whether a lookup can use the fallback locale.
Get the node type the collector inspects.
Collect the translation looked up through a translator.
Details
in
CollectsTranslationLookups at line 34
protected array|null
translationLookup(CallLike $call, bool $choice, bool $acceptsFallback, Scope|null $scope)
Get the lookup made by a call with a literal translation key.
in
CollectsTranslationLookups at line 71
protected array|null
translationLocales(Expr|null $locale, Scope|null $scope)
Get the locales a lookup can use, where null is the translator's current locale.
in
CollectsTranslationLookups at line 107
protected bool
translationFallback(Expr|null $fallback, Scope|null $scope)
Determine whether a lookup can use the fallback locale.
An unknown value counts as true: a translation missing with the fallback locale is also missing without it.
at line 32
string
getNodeType()
Get the node type the collector inspects.
at line 44
array|null
processNode(Node $node, Scope $scope)
Collect the translation looked up through a translator.