etranslate.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 
25 namespace etranslate {
31  void init(int _argc, const char** _argv);
35  void unInit();
42  void addPath(const std::string& _lib, const std::string& _path, bool _major = false);
48  const std::string& getPaths(const std::string& _lib);
53  void setLanguageDefault(const std::string& _lang);
58  const std::string& getLanguageDefault();
63  void setLanguage(const std::string& _lang);
68  const std::string& getLanguage();
72  void autoDetectLanguage();
78  std::string get(const std::string& _instance);
79 };
80 // Here we define a simple macro to Translate all string simply:
81 #define TRANSLATE(a) etranslate::get(a)
void setLanguageDefault(const std::string &_lang)
Set the default language to load data (the default language might contain all internal data for the b...
void setLanguage(const std::string &_lang)
Set the language to load data. when no data availlable, we get the default language.
const std::string & getPaths(const std::string &_lib)
Get the current paths of the library.
const std::string & getLanguage()
Get the current language loaded.
This is a simple interface to converte application display string in a generic current system languag...
Definition: etranslate.hpp:25
void unInit()
Un-Initialize etranslate.
const std::string & getLanguageDefault()
Get the current language selected.
void autoDetectLanguage()
Automatic detection of the system language.
void init(int _argc, const char **_argv)
Initialize etranslate.
void addPath(const std::string &_lib, const std::string &_path, bool _major=false)
Set the path folder of the translation files.