xtd - Reference Guide 0.2.0
translator.h
Go to the documentation of this file.
1 #pragma once
5 #include <string>
6 #include <vector>
8 #include "static.h"
9 #include "ustring.h"
10 
12 namespace xtd {
19  class translator final static_ {
20  public:
22 
24  static xtd::ustring language();
25  static void language(const xtd::ustring& language);
26 
27  static std::vector<xtd::ustring> languages();
28 
29  static xtd::ustring system_language();
31 
33 
35  static void add_value(const xtd::ustring& language, const xtd::ustring& key, const xtd::ustring& value);
36 
37  static void parse_locale(const xtd::ustring& locale_path);
38 
39  static void parse_file(const xtd::ustring& file, const xtd::ustring& language);
40 
41  static xtd::ustring translate(const xtd::ustring& value) {return translate(language(), value);}
42  static xtd::ustring translate(const xtd::ustring& language, const xtd::ustring& value);
43  static const char* translate(const char* value) {return translate(language(), value);}
44  static const char* translate(const xtd::ustring& language, const char* value);
46 
47  private:
48  static void initialize();
49  static std::map<xtd::ustring, xtd::collections::specialized::string_map> language_values_;
50  static xtd::ustring language_;
51  };
52 }
Contains xtd::static_object class.
#define static_
This keyword is use to represent a static object. A static object can&#39;t be instantiated (constructors...
Definition: static.h:38
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Contains xtd::collections::specialized::string_map typedef.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:50
Contains xtd::ustring class.
Represents translator class. This class cannot be inherited.
Definition: translator.h:19