[development] code proposal: localization of currency, ...

Hans Salvisberg drupal at salvisberg.com
Mon Oct 22 07:46:02 UTC 2007


Ivan Sergio Borgonovo wrote:

> The site will be displayed in Spanish, with Spanish format of
> currency. If "Spanish" means some of the Latin American countries
> that may have a different format for currencies... let it be...


Why won't you understand that this is not good enough? By releasing something that works only some of the time, and only for your favorite countries, you'd do more harm than good, because a lot of less-educated people might start using it, thinking that it acually works.

Drupal's "localization" is nothing more than a language selection. It's acceptable as far as language selection goes, but it's much too coarse to really be called "localization," and certainly not suited as a base for something as complex as currency formatting.


> Anyway the format functions will support a "language" parameter that
> will override the current user language.

IT'S NOT A QUESTION OF LANGUAGE!!!


> I'm not proposing a catch them all solution and I think this facility
> won't get into the way of people.

Yes, it will. Once module writers start to use it, site administrators will not only have to deal with one (possibly sub-optimal) currency format, but with one per language, which is clearly worse.

> People writing modules will know what will happen to their
> currency/float if they wrap them with the formatting functions.

No, they won't! They'll just (wrongly!) assume that it'll do the right thing for most users, which shifts the plague over to the site administrators!


What might be useful for many sites is an API with an options page that lets the site administrator freely define THE currency format for the site (completely independent of lanugage!). He'd still only have one, but at least he'd have the one he selected. That would be a big step forward.

Don't try to be smart. Software that tries to be smart and to guess the user's wishes (based on the author's less than perfect view of the world) is absolutely maddening!

Hans




More information about the development mailing list