forked from fnc12/Mitsoko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Language.hpp
38 lines (29 loc) · 921 Bytes
/
Language.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef __VIPER_LANGUAGE_H
#define __VIPER_LANGUAGE_H
#include <string>
#include <mutex>
#include "iOSutil/iOSutil.hpp"
#include "AndroidUtil/AndroidUtil.hpp"
#include "R/Strings.hpp"
namespace Viper{
struct Language{
static const std::string& current();
static void setCurrent(const std::string &newValue);
protected:
static std::string _current;
static std::mutex languageOnceMutex;
};
std::string localizedString(const std::string &key,const std::string &lang);
std::string localizedString(const std::string &key);
/**
* Localized string syntax sugar.
*/
std::string operator"" _ls (const char *s,size_t len);
/**
* Functor for lambda replacing in STL algorithms.
*/
struct Localizator{
std::string operator()(const std::string &s) const;
};
}
#endif /* __VIPER_LANGUAGE_H */