libqi-api  2.1.4.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
translator.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Aldebaran Robotics. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the COPYING file.
5  */
6 
7 #ifndef _QI_TRANSLATOR_HPP_
8 #define _QI_TRANSLATOR_HPP_
9 
10 # include <boost/noncopyable.hpp>
11 # include <string>
12 # include <qi/api.hpp>
13 
14 namespace qi
15 {
16  class TranslatorPrivate;
17  class QI_API Translator : private boost::noncopyable
18  {
19  public:
20  Translator(const std::string &name);
21  ~Translator();
22 
23  std::string translate(const std::string &msg,
24  const std::string &domain = "",
25  const std::string &locale = "");
26 
27  void setCurrentLocale(const std::string &locale);
28  void setDefaultDomain(const std::string &domain);
29  void addDomain(const std::string &domain);
30 
31  private:
32  TranslatorPrivate *_p;
33  };
34 
35  QI_API qi::Translator &defaultTranslator(const std::string &name);
36 
37  QI_API std::string tr(const std::string &msg,
38  const std::string &domain = "",
39  const std::string &locale = "");
40 
41  namespace detail
42  {
43  QI_API void addDomainPath(const std::string &path);
44  QI_API void removeDomainPath(const std::string &path);
45  }
46 
47 }
48 
49 #endif // _QI_TRANSLATOR_HPP_
void removeDomainPath(const std::string &path)
qi::Translator & defaultTranslator(const std::string &name)
Get a reference on the default Translator.
std::string tr(const std::string &msg, const std::string &domain="", const std::string &locale="")
Translate a message.
void addDomainPath(const std::string &path)
dll import/export and compiler message
#define QI_API
Definition: api.hpp:24