- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
qi::Translator Class Reference

Localization of your source code. More...

`#include <translator.hpp>`

## Public Member Functions
| Translator (const std::string &name)
| Constructor. More...
| ~Translator ()
std::string | translate (const std::string &msg, const std::string &domain="", const std::string &locale="", const std::string &context="")
| Translate a message. More...
std::string | translateContext (const std::string &msg, const std::string &context)
| Translate a message with a specific context. More...
void | setCurrentLocale (const std::string &locale)
| Change the locale at runtime. More...
void | setDefaultDomain (const std::string &domain)
| Set the default Domain. More...
void | addDomain (const std::string &domain)
| Add a new dicationary of messages. More...

## Detailed Description

Localization of your source code.

make your application or library speak in the user's language.

Definition at line 24 of file translator.hpp.

## Constructor & Destructor Documentation

qi::Translator::Translator | ( | const std::string & | name | ) |

Constructor.

Parameters

  name | Application or Library name

qi::Translator::~Translator | ( |  | ) |

## Member Function Documentation

void qi::Translator::addDomain | ( | const std::string & | domain | ) |

Add a new dicationary of messages.

Parameters

  domain | Domain name.

void qi::Translator::setCurrentLocale | ( | const std::string & | locale | ) |

Change the locale at runtime.

Parameters

  locale | Locale name formatted as xx_XX (country and language code).

void qi::Translator::setDefaultDomain | ( | const std::string & | domain | ) |

Set the default Domain.

Parameters

  domain | Domain name.

std::string qi::Translator::translate | ( | const std::string & | msg,
|  | const std::string & | domain = `""`,
|  | const std::string & | locale = `""`,
|  | const std::string & | context = `""`
| ) |  |

Translate a message.

Parameters

  msg | Message to translate
  domain | Domain name
  locale | Locale name
  context | Context of the msg

Returns
  The translated message

std::string qi::Translator::translateContext | ( | const std::string & | msg,
|  | const std::string & | context
| ) |  |

Translate a message with a specific context.

Parameters

  msg | Message to translate
  context | Context of the msg

Returns
  The translated message

The documentation for this class was generated from the following file:

- /home/opennao/work/release-2.8/sdk/libqi/qi/translator.hpp