CLDR metazone data- ZF gonna use this anytime soon?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CLDR metazone data- ZF gonna use this anytime soon?

MilSF1
Thomas,

I was hoping that you might be able to tell me if there were any plans to include the metazone data included in the latest CLDR versions. The one thing that CLDR now does better than the Olsen DB is localization of tz abbreviations. This is actually an issue on one of the editions I support at work: The abbreviation for Asia/Jakarta in Olsen is WIT (Western Indonesian Time). Unfortunately, WIT is used in Indonesia for the EASTERN time zone (Waktu Indonesia Timur). In Indonesian, the Asia/Jakarta tz is abbreviated WIB (Waktu Indonesia Barat). So right now I had to put a manual check into our Zend_Date extender class to flip from WIT to WIB. I hate hacks like that. It would be great if Zend_Date used the CLDR <metazone> data instead of Olsen for tz abbreviations. In my case id.xml has the right abbreviations, fwiw.

Coding this (switch type in Zend_Locale_Data::getContent() ?) looks to be a two part process. Use the timezone ID to get the metazone name from supplemental/metaZones.xml, then use that name in the data files to get the full, localized metazone data. I'm not fully up to date on the internals of Zend_Date, but I'm guessing this would fit into the _parseIsoToDate() switch statement:

case self::TIMEZONE :
            case 'v' :
            case 'zz' :
            case 'zzz' :
                return 'T';  <---- Replace with $this->_toComment() that contains the localized data
                break;

If this sounds like a good idea, and it's not already being implemented, I might try to find the time to code this up. Even if not implemented into Zend_Date, it would be nice to at least pull the data in Zend_Locale_Data.

--MDG
Reply | Threaded
Open this post in threaded view
|

AW: [fw-i18n] CLDR metazone data- ZF gonna use this anytime soon?

Thomas Weidner
Hy,

I18n where Zend_Locale and Zend_Date belong to is actually being reworked
within ZF2.
But this is a long-term process and not finished for now.

Within ZF1 there will be no change to existing behaviour.
But you can get this output with Zend_Date even within ZF1.

Get the timezone from Zend_Locale manually (metazones are contained) and
enter the result as plain text within Zend_Date instead of "ZZZZ".
Something like the following works:

$timezone = Zend_Locale::getContent(xxxx);
$date->toString("dd.MM.YYYY HH:mm:ss '" . $timezone . "'");

Thomas Weidner

Zend Framework Certified Engineer & I18N Team Leader
http://www.thomasweidner.com

-----Urspr√ľngliche Nachricht-----
Von: MilSF1 [mailto:[hidden email]]
Gesendet: Samstag, 14. Mai 2011 07:24
An: [hidden email]
Betreff: [fw-i18n] CLDR metazone data- ZF gonna use this anytime soon?

Thomas,

I was hoping that you might be able to tell me if there were any plans to
include the metazone data included in the latest CLDR versions. The one
thing that CLDR now does better than the Olsen DB is localization of tz
abbreviations. This is actually an issue on one of the editions I support at
work: The abbreviation for Asia/Jakarta in Olsen is WIT (Western Indonesian
Time). Unfortunately, WIT is used in Indonesia for the EASTERN time zone
(Waktu Indonesia Timur). In Indonesian, the Asia/Jakarta tz is abbreviated
WIB (Waktu Indonesia Barat). So right now I had to put a manual check into
our Zend_Date extender class to flip from WIT to WIB. I hate hacks like
that. It would be great if Zend_Date used the CLDR <metazone> data instead
of Olsen for tz abbreviations. In my case id.xml has the right
abbreviations, fwiw.

Coding this (switch type in Zend_Locale_Data::getContent() ?) looks to be a
two part process. Use the timezone ID to get the metazone name from
supplemental/metaZones.xml, then use that name in the data files to get the
full, localized metazone data. I'm not fully up to date on the internals of
Zend_Date, but I'm guessing this would fit into the _parseIsoToDate() switch
statement:

case self::TIMEZONE :
            case 'v' :
            case 'zz' :
            case 'zzz' :
                return 'T';  <---- Replace with $this->_toComment() that
contains the localized data
                break;

If this sounds like a good idea, and it's not already being implemented, I
might try to find the time to code this up. Even if not implemented into
Zend_Date, it would be nice to at least pull the data in Zend_Locale_Data.

--MDG

--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/CLDR-metazone-data-ZF-g
onna-use-this-anytime-soon-tp3521776p3521776.html
Sent from the Zend I18N/Locale mailing list archive at Nabble.com.

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]




--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: AW: [fw-i18n] CLDR metazone data- ZF gonna use this anytime soon?

MilSF1
Thomas,

Sorry if I was confusing, but what I was saying in my email is that metazone information is not being used in ZF 1.11.6 in any way; mainly because the CLDR version included in ZF is older than when they started including that data. My suggestion was for future development. If you download the 1.9.1 data files, you will see that ldml/dates/timeZoneNames now has additional data like:

(from id.xml Lines:1900-26)
<metazone type="Indonesia_Central">
    <long>
        <standard>Waktu Indonesia Tengah</standard>
    </long>
    <short>
        <standard>WITA</standard>
    </short>
    <commonlyUsed>true</commonlyUsed>
</metazone>
<metazone type="Indonesia_Eastern">
    <long>
        <standard>Waktu Indonesia Timur</standard>
    </long>
    <short>
        <standard>WIT</standard>
    </short>
    <commonlyUsed>true</commonlyUsed>
</metazone>
<metazone type="Indonesia_Western">
    <long>
        <standard>Waktu Indonesia Barat</standard>
    </long>
    <short>
        <standard>WIB</standard>
    </short>
    <commonlyUsed>true</commonlyUsed>
</metazone>

These are the abbreviations I was talking about. Any current tz abbreviations in ZF come from PHP's date() which uses the underlying operating system timezone database when you ask for the abbreviation. On *nix, this is the Olson db (sorry for the typo in my first email).

--Mark G.

Thomas Weidner wrote
But you can get this output with Zend_Date even within ZF1.

Get the timezone from Zend_Locale manually (metazones are contained) and
enter the result as plain text within Zend_Date instead of "ZZZZ".
Something like the following works:

$timezone = Zend_Locale::getContent(xxxx);
$date->toString("dd.MM.YYYY HH:mm:ss '" . $timezone . "'");

Thomas Weidner