[Fwd: Re: ICU ResourceBundles for ext/unicode]
| From: | Michael Wallner | Date: | Tue, 02 Jan 2007 07:37:08 +0000 |
| Subject: | [Fwd: Re: ICU ResourceBundles for ext/unicode] | ||
| Groups: | php.i18n | ||
| Request: | Send a blank email to php-i18n+get-1046@lists.php.net to get a copy of this message | ||
-------- Original Message --------
Subject: Re: ICU ResourceBundles for ext/unicode
Date: Sun, 31 Dec 2006 13:11:26 +0100
From: Michael Wallner <mike@php.net>
To: Norbert Lindenberg <Norbert.Lindenberg@yahoo-inc.com>
CC: Andrei Zmievski <andrei@gravitonic.com>
Newsgroups: php.i18n
References: <A759ED92-D191-4F94-A72D-C026C2E98127@yahoo-inc.com>
Norbert Lindenberg wrote:
> Hi all,
Hi Norbert!
> The ICU style of resource bundles is Unicode based, but also seems more
> complicated than desirable for PHP. It's designed for a statically typed
> environment and requires compilation, neither of which fit in well with
> PHP.
That's probably true. But the same applies to the past and gettext.
>
> I'd rather start with Java properties files, the simplest and most
> widely used form of Java resource files. I'd adapt them to PHP 6 by
> switching their encoding to UTF-8, adopting heredocs, and simplifying
> their syntax. I'd drop the secondary fallback mechanism, in which
> resource bundles can inherit individual resources from other bundles.
> This is an optimization to reduce the size of bundles at the expense of
> runtime overhead and additional work in creating the bundles. The
> additional step of finding common resources and moving them to shared
> bundles is rarely made in normal localization processes, and the space
> savings don't matter much for PHP, where bundles remain on the server.
> Dropping the secondary fallback also means that we can simplify the
> resource bundle to just an array.
> [...]
> What do you think?
The idea is quite confusing to me...
I don't see any compelling reasons to create a new file format and write
a parser for it from scratch. I could understand if you suggested to implement
a parser for plaintext ICU resourcebundle templates, which would extinct the
compilation process and wouldn't benefit from the fallback mechanism. I guess
we could even exploit icu/source/tools/genrb/parse.c for that matter.
Regards,
--
Michael
--
Michael