Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / nel / samples / misc / i18n / main.cpp
blob5b1c731230ba53a01e9fd2b46adeee51311c6793
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <string>
21 #include <iostream>
23 // contains all i18n features
24 #include "nel/misc/i18n.h"
26 // contains the path features
27 #include "nel/misc/path.h"
29 #ifndef NL_LANG_DATA
30 #define NL_LANG_DATA "."
31 #endif // NL_LANG_DATA
33 using namespace NLMISC;
35 int main (int argc, char **argv)
37 createDebug();
39 // Add the language data path to the search path.
40 CPath::addSearchPath(NL_LANG_DATA);
42 InfoLog->displayRawNL("Please, choose 'en', 'fr' or 'de' and press <return>");
44 std::string langName;
45 std::getline(std::cin, langName);
47 // load the language
48 CI18N::load(langName);
50 InfoLog->displayRawNL(CI18N::get("Hi").c_str());
51 InfoLog->displayRawNL(CI18N::get("PresentI18N").c_str(), "Nevrax");
52 InfoLog->displayRawNL(CI18N::get("ExitStr").c_str());
53 getchar();
55 return EXIT_SUCCESS;