taiwen / pi

Pi Engine in process
5 stars 0 forks source link

Localization #4

Open voltan opened 11 years ago

voltan commented 11 years ago

ZF2 I18n have some good options and standard for Localization, View Localization is very important and I18n Helper have some good options like CurrencyFormat, DateFormat, NumberFormat and We need plane for useage

All of them get some methods , but manage methods for each language is important, It possible to have config file or options for each language? like

<?php 

return array(
    'locale' => 'en_US',
    'dateType' => IntlDateFormatter::MEDIUM,
    'timeType' => IntlDateFormatter::MEDIUM,
    'formatStyle' => NumberFormatter::DECIMA,
    'formatType'  => NumberFormatter::TYPE_DEFAULT,
    'currencyCode' => '',
    'showDecimals' => '',
);

?>

And load / use this parameters in templates. for example add $this->numberFormat(); for all numbers or $this->dateFormat(); for all dates

date Localization is too important, for example in persian language we have local date and other langaues is lake this. for example :

http://en.wikipedia.org/wiki/Iranian_calendar http://en.wikipedia.org/wiki/Jalali_calendar

http://en.wikipedia.org/wiki/Gregorian_calendar http://en.wikipedia.org/wiki/Chinese_calendar http://en.wikipedia.org/wiki/Hebrew_calendar http://en.wikipedia.org/wiki/Islamic_calendar

For Persian calendar we have this php function : https://github.com/vahid-sohrabloo/Pdate

Other important think is local image / logo ( by theme or language ) like your codes in X2 newbb module