yiisoft / view

Yii view rendering library
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
56 stars 44 forks source link

Add `getLocale()` method #242

Closed Tigrov closed 11 months ago

Tigrov commented 1 year ago

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

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues -
what-the-diff[bot] commented 1 year ago

PR Summary

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (38e7351) 99.74% compared to head (3daa0ff) 99.74%. Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ 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 ``` | [Files](https://app.codecov.io/gh/yiisoft/view/pull/242?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yiisoft) | Coverage Δ | | |---|---|---| | [src/State/WebViewState.php](https://app.codecov.io/gh/yiisoft/view/pull/242?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yiisoft#diff-c3JjL1N0YXRlL1dlYlZpZXdTdGF0ZS5waHA=) | `100.00% <ø> (ø)` | | | [src/ViewTrait.php](https://app.codecov.io/gh/yiisoft/view/pull/242?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yiisoft#diff-c3JjL1ZpZXdUcmFpdC5waHA=) | `100.00% <100.00%> (ø)` | | | [src/WebView.php](https://app.codecov.io/gh/yiisoft/view/pull/242?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=yiisoft#diff-c3JjL1dlYlZpZXcucGhw) | `100.00% <ø> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

samdark commented 11 months ago

👍