UsedTranslationViewCollector
class UsedTranslationViewCollector
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.
Constants
| private COMPONENT_TAG_REGEX |
Component tags, whose attributes are matched as Blade matches them. |
| private BOUND_ATTRIBUTE_REGEX |
Component attributes bound with a single colon or bind:, whose values are PHP expressions. |
| private ECHO_REGEXES |
Echoes in Blade's compile order: raw, escaped, then regular. An @ prefix leaves an echo as text. |
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.
Create a new collector instance.
Get the translations looked up by the root views, keyed by view file.
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 83
__construct(ViewParser $viewParser, BladeScanner $bladeScanner, ViewFileHelper $viewFileHelper, Filesystem $filesystem)
Create a new collector instance.
at line 96
array
getUsedTranslations()
Get the translations looked up by the root views, keyed by view file.