English 中文(简体)
如何处理地方化问题? 我是否应当遵循标准?
原标题:How to deal with localization? Is there a standard I should follow?

我试图开设一套处理本地化问题的班级(主要是货币部分,但也包括语言)。

我可以想象这一逻辑如何,但我不知道用什么名称来使用不同的语言和货币。 我已经看到这方面的许多标准化组织标准?

在这里,如果你也能够帮助,那么我所想的逻辑就是:

I would have a Money class, with amount and currency attributes. On creation, the object receives the amount and the currency (an object provided by the localization class maybe?). You can add to or multiply the amount. The add method takes another money object as parameter, and if it has a different currency, a convertion is made automatically. Somewhere an array is stored with all the standard names such as en_US and USD, relating them appropiately, and also relating them to the equivalent in USD as a scalar value. Money objects should be able to print the amounts in different formats, such as $ 1000, or U$s, etc.

  • Is this a good way to deal with this?
  • Which standar should I follow?
  • Do you know any already existent, decoupled php libraries to do this?
最佳回答
问题回答

通常,我只字不表示对网的反射,但检查这些地方化的方式。 这是我所看到的最小规模执行工作之一。

象谷歌这样的高度动态应用并不大,而是静态形式、货币等标题的弹性。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签