/*
 * $Id: Translation.cpp 88 2008-12-10 18:31:39Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Common/include/Environment.h"
#include "Common/include/Translation.h"
#include "Common/include/ErrorMorpheo.h"

namespace morpheo {

  static bool translation_initialized;

  void translation (void)
  {
#ifdef TRANSLATION
    if (not translation_initialized)
      {
        environment();
        
        std::string dirname = MORPHEO_TOPLEVEL;
        dirname += "/IPs/systemC/processor/Morpheo/locale";

        if (bindtextdomain(MORPHEO_PACKAGE,dirname.c_str()) == NULL)
          throw ERRORMORPHEO("Translation","Error in set directory containing message catalogs.\n");
        
        translation_initialized = true;
      }
#endif    
  }

}; // end namespace morpheo
