xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
translator.h
Go to the documentation of this file.
1
4#pragma once
5#include <filesystem>
6#include <string>
7#include <vector>
9#include "static.h"
10#include "ustring.h"
11
13namespace xtd {
20 class translator final static_ {
21 public:
22 static xtd::ustring language();
23 static void language(const xtd::ustring& language);
24
25 static std::vector<xtd::ustring> languages();
26
27 static xtd::ustring system_language();
28
29 static void add_value(const xtd::ustring& language, const xtd::ustring& key, const xtd::ustring& value);
30
31 static void parse_locale(const xtd::ustring& locale_path);
32
33 static void parse_file(const xtd::ustring& file, const xtd::ustring& language);
34
35 static xtd::ustring translate(const xtd::ustring& value) {return translate(language(), value);}
36 static xtd::ustring translate(const xtd::ustring& language, const xtd::ustring& value);
37 static const char* translate(const char* value) {return translate(language(), value);}
38 static const char* translate(const xtd::ustring& language, const char* value);
39
40 private:
41 static void initialize();
42 static std::map<xtd::ustring, xtd::collections::specialized::string_map> language_values_;
43 static xtd::ustring language_;
44 };
45}
Represents translator class. This class cannot be inherited.
Definition: translator.h:20
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:38
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::static_object class.
Contains xtd::collections::specialized::string_map typedef.
Contains xtd::ustring class.