-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Created a LocalizedFormatter class #2054
Conversation
Isn't it better to make |
What about BC then? I think for yii2 it should be, in yii1 this would change completely how it works. |
A flag? |
*/ | ||
public function formatBoolean($value) | ||
{ | ||
return $value ? Yii::t('yii','Yes') : Yii::t('yii','No'); |
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.
Whould not it be better, if we convert "CFormatter::$booleanFormat" into a virtual property via setter/getter?
Then we can overwrite the default value initialization with "Yii::t()" usage.
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.
Whould not it be better, if we convert "CFormatter::$booleanFormat" into a virtual property via setter/getter?
This is not possible for BC reasons, when someone extended CFormatter and overrided the property with his values it will not work after we changed it to getters and setters.
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.
I see.
Looks good for me, although pull from upstream needed to be perfromed. |
@samdark can't see a clean good way to do it, right now. Anything against merging this? |
Would it work by replacing |
Yep. |
* 1818-localized-formatter: documentation and changelog for localized formatter Created a LocalizedFormatter class Conflicts: CHANGELOG
issue #1818