libqi-api  2.0.6.8
/home/opennao/work/master/sdk/libqi/qi/translator.hpp
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2013 Aldebaran Robotics. All rights reserved.
00003  * Use of this source code is governed by a BSD-style license that can be
00004  * found in the COPYING file.
00005  */
00006 
00007 #ifndef _QI_TRANSLATOR_HPP_
00008 #define _QI_TRANSLATOR_HPP_
00009 
00010 # include <boost/noncopyable.hpp>
00011 # include <string>
00012 # include <qi/api.hpp>
00013 
00014 namespace qi
00015 {
00016   class TranslatorPrivate;
00017   class QI_API Translator : private boost::noncopyable
00018   {
00019   public:
00020     Translator(const std::string &name);
00021     ~Translator();
00022 
00023     std::string translate(const std::string &msg,
00024                           const std::string &domain = "",
00025                           const std::string &locale = "");
00026 
00027     void setCurrentLocale(const std::string &locale);
00028     void setDefaultDomain(const std::string &domain);
00029     void addDomain(const std::string &domain);
00030 
00031   private:
00032     TranslatorPrivate *_p;
00033   };
00034 
00035   QI_API qi::Translator &defaultTranslator(const std::string &name);
00036 
00037   QI_API std::string tr(const std::string &msg,
00038                         const std::string &domain = "",
00039                         const std::string &locale = "");
00040 
00041   namespace detail
00042   {
00043     QI_API void addDomainPath(const std::string &path);
00044     QI_API void removeDomainPath(const std::string &path);
00045   }
00046 
00047 }
00048 
00049 #endif  // _QI_TRANSLATOR_HPP_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines