title: PHP simple translation approach - your opinion
body: <p>I am doing a PHP web site, without using any framework. I need that the site is available in several languages, and I was reading about it and it seems to be a little bit confusing. There are several solutions but all seem to depend on a specific framework.</p>
  
  <p>What you think of using a simple translation function like the one shown below?</p>
  
  <p>I mean, I would like to know what can be a disadvantage of using such code.
  Here it is (this is just a simple and incomplete sample):</p>
  
  <pre><code>class Translator{
  
      private $translations;
  
      public function __construct(){
          $this-&gt;translations = array(
              'Inbox'  =&gt; array(
                  'en' =&gt; 'Inbox',
                  'fr' =&gt; 'the french word for this'
              ),
              'Messages' =&gt; array(
                  'en' =&gt; 'Messages',
                  'fr' =&gt; 'the french word for this'
              )
              //And so on...
          );
      }
  
      public function translate($word,$lang){
          echo $this-&gt;translations[$word][$lang];
      }
  }
  </code></pre>