1 /************************************************************************************ 2 3 AstroMenace 4 Hardcore 3D space scroll-shooter with spaceship upgrade possibilities. 5 Copyright (c) 2006-2019 Mikhail Kurinnoi, Viewizard 6 7 8 AstroMenace is free software: you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation, either version 3 of the License, or 11 (at your option) any later version. 12 13 AstroMenace is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with AstroMenace. If not, see <https://www.gnu.org/licenses/>. 20 21 22 Website: https://viewizard.com/ 23 Project: https://github.com/viewizard/astromenace 24 E-mail: viewizard@viewizard.com 25 26 *************************************************************************************/ 27 28 #ifndef CORE_TEXT_TEXT_H 29 #define CORE_TEXT_TEXT_H 30 31 #include "../base.h" 32 33 namespace viewizard { 34 35 // Initialization. Load file with translation in .csv format (supported by LibreOffice Calc). 36 int vw_InitText(const char *FileName, const char SymbolSeparator, const char SymbolEndOfLine); 37 // Set default language. 38 void vw_SetTextLanguage(unsigned int Language); 39 // Get UTF8 text for particular language. 40 const std::string &vw_GetText(const std::string &ItemID, 41 unsigned int Language = 999999 /*should be greater than loaded languages number*/); 42 // Get UTF32 text for particular language. 43 const std::u32string &vw_GetTextUTF32(const std::string &ItemID, 44 unsigned int Language = 999999 /*should be greater than loaded languages number*/); 45 // Find all used in text characters for current language. 46 std::unordered_set<char32_t> &vw_FindCharsSetForLanguage(); 47 // Release data. 48 void vw_ReleaseText(); 49 // Get available languages count. 50 unsigned int vw_GetLanguageListCount(); 51 52 } // viewizard namespace 53 54 #endif // CORE_TEXT_TEXT_H 55