Make Formats default values international #1818

Closed
fleuryc opened this Issue Dec 6, 2012 · 5 comments

Comments

4 participants

fleuryc commented Dec 6, 2012

Hi,

I know you can configure http://www.yiiframework.com/doc/api/1.1/CFormatter#booleanFormat-detail and all as you wish.
But it would be nice if instead of plain array('No', 'Yes') and all, we had the same but translated in the locale as default (and still customizable).

This applies to every formats that can be localized (date, time, number...).

Cheers!

Contributor

magefad commented Dec 6, 2012

👍

cebe was assigned Dec 7, 2012

Owner

cebe commented Dec 7, 2012

When we do this change we should also set all the date, time and number formats to the locale specific per default.
For 1.1.x this should be an optional setting.

Owner

cebe commented Dec 7, 2012

Maybe we could introduce a CLocalizedFormatter that sets localized format configuration on init().

Usage would be configure application config like this (replace original formatter):

'components' => array(
    'format' => array(
        'class' => 'CLocalizedFormatter',
    ),
),

@yiisoft/core-developers what do you think about this?

fleuryc commented Dec 7, 2012

@cebe seems good to me!

Contributor

sauloonze commented Dec 7, 2012

+1

@cebe cebe added a commit to cebe/yii that referenced this issue Jan 30, 2013

@cebe cebe Created a LocalizedFormatter class
issue #1818
9630a88

cebe closed this May 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment