title: Php multilanguage date: howto?
body: <p>Nota: this is not a duplicate of <a href="https://stackoverflow.com/questions/4975854/translating-php-date-for-multilingual-site">Translating PHP date() for Multilingual Site</a> . I've read it!</p>
  
  <p>I'm sorry, I first have to explain how my framework works, so you can understand precisely where my problem is:</p>
  
  <p>Here's how my Php code works (rough principles). Let's use for an example someone who wants to see the URL <code>http://myweb.com/valid.php</code>:</p>
  
  <ul>
  <li>in the file <code>valid.php</code> the code include the right classes definition then create one object and call the function <code>display()</code> which displays the page.</li>
  <li>in the file <code>valid.php</code>, when the object is created, it analyses the host, and in the host there's the language (<code>http://</code><strong><code>us</code></strong><code>.myweb.com/</code>, <code>http://</code><strong><code>cn</code></strong><code>.myweb.com/</code>, <code>http://</code><strong><code>fr</code></strong><code>.myweb.com/</code>...) and the default language (if none found) is english</li>
  <li>then I load a cached Php file where the are the translations. This is a <code>translation</code> object, that I'm calling <strong><code>$t</code></strong> for short</li>
  <li>and from now on, whenever I want a translation, I just do things like <code>$t-&gt;get('my_string')</code>.</li>
  </ul>
  
  <p>Let's take an example with 2 languages file:</p>
  
  <ul>
  <li>2 languages files: <code>cache.us.php</code> and <code>cache.fr.php</code></li>
  <li>in <code>cache.us.php</code> you have a line like this: <code>$thanks_for_the_fish = "Thanks for the fish"</code>.</li>
  <li>in <code>cache.fr.php</code> you have a line like this: <code>$thanks_for_the_fish = "Merci pour le poisson"</code>.</li>
  <li>I construct my page, include the right language file then call <code>$t-&gt;get('thanks_for_the_fish')</code> and it's translated.</li>
  </ul>
  
  <p>Now my problem comes with date formatting.
  With short date format it's not a problem:</p>
  
  <ul>
  <li>in <code>cache.us.php</code>: <code>$short_date_format = "m/d/Y, H:i"</code>.</li>
  <li>in <code>cache.fr.php</code>: <code>$short_date_format = "d/m/Y à H:i"</code>.</li>
  </ul>
  
  <p>But with <strong>long</strong> date format, I'm just working on french and I begun with something like:</p>
  
  <ul>
  <li>in <code>cache.fr.php</code>: <code>$long_date_format = "%s, %d %s %d"</code>.</li>
  <li>then all the days: <code>$sunday = "dimanche"</code>, <code>$monday = "lundi"</code> and so on</li>
  <li>then in my translation code:</li>
  </ul>
  
  <p>Something like this (read carefully the comment in the code, my question is in it!):</p>
  
  <pre><code>static private $_TabStrDaysOfWeek = array(
      0 =&gt; 'sunday',
      1 =&gt; 'monday',
      ...,
      6 =&gt; 'saturday'
  );
  public function translateDate($date_time)
  {
      $long_day = $this-&gt;tr-&gt;get(
          $this-&gt;_TabStrDaysOfWeek[ $date_time-&gt;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
      */
  }
  </code></pre>
  
  <p>... And I said arabian because I'll need it sooner or later, same for Mandarin Chinese.
  All my other translation problems are solved but this one!!</p>
  
  <p>Any idea?</p>