Orxonox: src/core/Language.h File Reference

# Language.h File Reference

Definition of the Language and the LanguageEntry class. More...

`#include "CorePrereqs.h"`
`#include <map>`
`#include <string>`
`#include <cassert>`

## Namespaces

namespace | orxonox

## Classes

class | orxonox::Language
| The Language class manges the language files and entries and stores the LanguageEntry objects in a map. More...
class | orxonox::LanguageEntry
| The LanguageEntry class stores the default- and the translated string of a given entry in the language file. More...

## Defines

#define | AddLanguageEntry(label, fallbackstring) orxonox::Language::getLanguage().addEntry(label, fallbackstring)
#define | GetLocalisation(label) orxonox::Language::getLanguage().getLocalisation(label)

## Detailed Description

Definition of the Language and the LanguageEntry class.

The Language class is used, to get a localisation of a string in the configured language. The string is identified by another string, the label of the entry. If the translation in the configured language isn't available, the default entry, defined in the code, is used.

Usage:

- Set the entry with the default string: Language::getLanguage()->addEntry("label of the entry", "the string to translate");

- Get the localisation of the entry in the configured language: std::cout << Language::getLanguage()->getLocalisation("name of the entry") << std::endl;

## Define Documentation

#define AddLanguageEntry | ( | label,
|  | fallbackstring |  | ) | orxonox::Language::getLanguage().addEntry(label, fallbackstring)

Referenced by orxonox::ConfigValueContainer::description(), orxonox::CommandExecutor::parse(), orxonox::Executor::setDescription(), orxonox::Executor::setDescriptionParam(), and orxonox::Executor::setDescriptionReturnvalue().

#define GetLocalisation | ( | label |  | ) | orxonox::Language::getLanguage().getLocalisation(label)

Referenced by orxonox::Executor::getDescription(), orxonox::ConfigValueContainer::getDescription(), orxonox::Executor::getDescriptionParam(), orxonox::Executor::getDescriptionReturnvalue(), and orxonox::CommandExecutor::parse().