-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getLocale()
method
#242
Conversation
PR Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #242 +/- ##
=========================================
Coverage 99.74% 99.74%
- Complexity 302 303 +1
=========================================
Files 18 18
Lines 796 798 +2
=========================================
+ Hits 794 796 +2
Misses 2 2
☔ View full report in Codecov by Sentry. |
*/ | ||
public function getLocale(): string | ||
{ | ||
return $this->localeState->getLocale(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's localeState
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question.
It is inside View
and WebView
Lines 39 to 45 in 9547650
final class WebView implements ViewInterface | |
{ | |
use ViewTrait; | |
private WebViewState $state; | |
private LocaleState $localeState; | |
And state
also
Lines 228 to 231 in 9547650
public function getTheme(): ?Theme | |
{ | |
return $this->state->getTheme(); | |
} |
This task for a new issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task for a new issue.
What is task?
ViewTrait
is internal trait that used in View
and WebView
only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task for a new issue.
What is task?
ViewTrait
is internal trait that used inView
andWebView
only.
Move localeState
and state
inside ViewTrait
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
👍 |
It needs to get current locale when page is rendering
<html lang="<?= Html::encode($view->getLocale()) ?>">
Also this will allow fix issue yiisoft/app#290