1 //**************************************************************************
3 //** ## ## ## ## ## #### #### ### ###
4 //** ## ## ## ## ## ## ## ## ## ## #### ####
5 //** ## ## ## ## ## ## ## ## ## ## ## ## ## ##
6 //** ## ## ######## ## ## ## ## ## ## ## ### ##
7 //** ### ## ## ### ## ## ## ## ## ##
8 //** # ## ## # #### #### ## ##
10 //** Copyright (C) 1999-2006 Jānis Legzdiņš
11 //** Copyright (C) 2018-2023 Ketmar Dark
13 //** This program is free software: you can redistribute it and/or modify
14 //** it under the terms of the GNU General Public License as published by
15 //** the Free Software Foundation, version 3 of the License ONLY.
17 //** This program is distributed in the hope that it will be useful,
18 //** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 //** GNU General Public License for more details.
22 //** You should have received a copy of the GNU General Public License
23 //** along with this program. If not, see <http://www.gnu.org/licenses/>.
25 //**************************************************************************
26 #ifndef VAVOOM_LANGUAGE_HEADER
27 #define VAVOOM_LANGUAGE_HEADER
37 TMap
<VName
, VLangEntry
> table
;
39 void FreeNonDehackedStrings ();
40 void ParseLanguageScript (vint32 Lump
, const char *InCode
, bool ExactMatch
, vint32 PassNum
);
41 VStr
HandleEscapes (VStr Src
);
44 VLanguage () noexcept
;
45 ~VLanguage () noexcept
;
47 void LoadStrings (const char *LangId
);
49 VStr
Find (VName Key
, bool *found
=nullptr) const;
50 VStr
Find (const char *s
, bool *found
=nullptr) const;
52 VStr
operator [] (VName Key
) const;
53 VStr
operator [] (const char *s
) const;
54 VStr
operator [] (const VStr
&s
) const;
57 VStr
Translate (const VStr
&s
) const;
59 bool HasTranslation (VName s
) const;
60 bool HasTranslation (const char *s
) const;
62 VName
GetStringId (VStr Str
);
63 VName
GetStringIdCI (VStr Str
);
64 void ReplaceString (VName
, VStr
);
68 extern VLanguage GLanguage
;