Php мультиязычная дата: как?

Примечание: это не дубликатПеревод даты PHP () для многоязычного сайта , Я прочитал это!

Извините, сначала я должен объяснить, как работает мой фреймворк, чтобы вы могли точно понять, где моя проблема:

Вот как работает мой Php-код (грубые принципы). Давайте использовать в качестве примера кого-то, кто хочет увидеть URLhttp://myweb.com/valid.php:

in the file valid.php the code include the right classes definition then create one object and call the function display() which displays the page. in the file valid.php, when the object is created, it analyses the host, and in the host there's the language (http://us.myweb.com/, http://cn.myweb.com/, http://fr.myweb.com/...) and the default language (if none found) is english then I load a cached Php file where the are the translations. This is a translation object, that I'm calling $t for short and from now on, whenever I want a translation, I just do things like $t->get('my_string').

Давайте возьмем пример с файлом с двумя языками:

2 languages files: cache.us.php and cache.fr.php in cache.us.php you have a line like this: $thanks_for_the_fish = "Thanks for the fish". in cache.fr.php you have a line like this: $thanks_for_the_fish = "Merci pour le poisson". I construct my page, include the right language file then call $t->get('thanks_for_the_fish') and it's translated.

Теперь моя проблема связана с форматированием даты. С коротким форматом даты это не проблема:

in cache.us.php: $short_date_format = "m/d/Y, H:i". in cache.fr.php: $short_date_format = "d/m/Y à H:i".

Но сlong формат даты, я просто работаю на французском, и я начал с чего-то вроде:

in cache.fr.php: $long_date_format = "%s, %d %s %d". then all the days: $sunday = "dimanche", $monday = "lundi" and so on then in my translation code:

Примерно так (внимательно прочитайте комментарий в коде, мой вопрос в нем!):

static private $_TabStrDaysOfWeek = array(
    0 => 'sunday',
    1 => 'monday',
    ...,
    6 => 'saturday'
);
public function translateDate($date_time)
{
    $long_day = $this->tr->get(
        $this->_TabStrDaysOfWeek[ $date_time->format('w') ]
    );
    /*

    here's where I'm stuck:
    what could be the code to be able to display:
    - english:
      Monday, 1st September 2006
      Tuesday, 2nd September 2006
      Wednesday, 3rd September 2006
      Thursday, 4th September 2006

    - french:
      Lundi, 1 septembre 2006
      Mardi, 2 septembre 2006
      Mercredi, 3 septembre 2006
      Jeudi, 4 septembre 2006

    - arabian!!:
      1 - Don't know
      2 - Don't know
      3 - Don't know
      4 - Don't know
    */
}

... и я сказал по-арабски, потому что мне это понадобится рано или поздно, то же самое для китайского языка мандарин. Все другие мои проблемы с переводом решены, кроме этой !!

Любая идея?

Ответы на вопрос(3)

Ваш ответ на вопрос