Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (15 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Common/src/Translation.cpp

    r82 r88  
    66 */
    77
    8 #include "../include/Translation.h"
    9 #include "../include/ErrorMorpheo.h"
     8#include "Common/include/Environment.h"
     9#include "Common/include/Translation.h"
     10#include "Common/include/ErrorMorpheo.h"
    1011
    1112namespace morpheo {
    1213
    13   Translation:: Translation (void)
     14  static bool translation_initialized;
     15
     16  void translation (void)
    1417  {
    15 #ifndef NO_TRANSLATION
    16     char * top_level = getenv("MORPHEO_TOPLEVEL");
    17    
    18     if (top_level == NULL)
    19       throw ERRORMORPHEO("Translation","Error morpheo environment is not positioned\n");
    20  
    21     std::string dirname = top_level;
    22     dirname += "IPs/systemC/processor/Morpheo/locale";
     18#ifdef TRANSLATION
     19    if (not translation_initialized)
     20      {
     21        environment();
     22       
     23        std::string dirname = MORPHEO_TOPLEVEL;
     24        dirname += "/IPs/systemC/processor/Morpheo/locale";
    2325
    24     bindtextdomain(MORPHEO_PACKAGE,dirname.c_str());
     26        if (bindtextdomain(MORPHEO_PACKAGE,dirname.c_str()) == NULL)
     27          throw ERRORMORPHEO("Translation","Error in set directory containing message catalogs.\n");
     28       
     29        translation_initialized = true;
     30      }
    2531#endif   
    2632  }
    2733
    28   Translation::~Translation (void)
    29   {
    30 
    31   }
    32 
    3334}; // end namespace morpheo
Note: See TracChangeset for help on using the changeset viewer.