forked from BoyC/GW2TacO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Language.h
39 lines (28 loc) · 862 Bytes
/
Language.h
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
39
#pragma once
#include "Bedrock/WhiteBoard/WhiteBoard.h"
class Language
{
public:
CString name;
CDictionary<CString, CString> dict;
};
class Localization
{
int activeLanguageIdx = 0;
CArray< Language > languages;
void ImportFile( const CString& file );
void ImportLanguage( CXMLDocument& d );
CArray<int> usedGlyphs;
public:
Localization();
void SetActiveLanguage( const CString& language );
CStringArray GetLanguages();
void Import();
CString Localize( const char* token, const CString& fallback = CString( "" ) );
CString Localize( const CString& token, const CString& fallback = CString( "" ) );
int GetActiveLanguageIndex();
CArray<int>& GetUsedGlyphs();
void ProcessStringForUsedGlyphs( CString& string );
};
extern Localization* localization;
#define DICT( token, ... ) localization->Localize( token, __VA_ARGS__ )