Skip to content
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

Merged
merged 2 commits into from
May 26, 2013
Merged

Conversation

cebe
Copy link
Member

@cebe cebe commented Jan 30, 2013

issue #1818

@samdark
Copy link
Member

samdark commented Jan 31, 2013

Isn't it better to make CFormatter locale aware?

@cebe
Copy link
Member Author

cebe commented Jan 31, 2013

What about BC then? I think for yii2 it should be, in yii1 this would change completely how it works.

@samdark
Copy link
Member

samdark commented Feb 1, 2013

A flag?

*/
public function formatBoolean($value)
{
return $value ? Yii::t('yii','Yes') : Yii::t('yii','No');
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

@klimov-paul
Copy link
Member

Looks good for me, although pull from upstream needed to be perfromed.

@cebe
Copy link
Member Author

cebe commented May 25, 2013

A flag?

@samdark can't see a clean good way to do it, right now. Anything against merging this?

@samdark
Copy link
Member

samdark commented May 26, 2013

Would it work by replacing formatter component with it w/o changing code? If yes, let's merge it.

@cebe
Copy link
Member Author

cebe commented May 26, 2013

Would it work by replacing formatter component with it w/o changing code?

Yep.

cebe added a commit that referenced this pull request May 26, 2013
* 1818-localized-formatter:
  documentation and changelog for localized formatter
  Created a LocalizedFormatter class

Conflicts:
	CHANGELOG
@cebe cebe merged commit ddbdbb1 into yiisoft:master May 26, 2013
@ghost ghost assigned cebe May 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants