English.cpp
1 /* 2 * Copyright (c) 2021-2025, The PurpleI2P Project 3 * 4 * This file is part of Purple i2pd project and licensed under BSD3 5 * 6 * See full license text in LICENSE file at top of project tree 7 */ 8 9 #include <map> 10 #include <vector> 11 #include <string> 12 #include <memory> 13 #include "I18N.h" 14 15 // English localization file 16 // This is an example translation file without strings in it. 17 18 namespace i2p 19 { 20 namespace i18n 21 { 22 namespace english // language namespace 23 { 24 // language name in lowercase 25 static std::string language = "english"; 26 27 // See for language plural forms here: 28 // https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html 29 static int plural (int n) { 30 return n != 1 ? 1 : 0; 31 } 32 33 // Right to Left language? 34 static bool rtl = false; 35 36 static const LocaleStrings strings 37 { 38 {"", ""}, 39 }; 40 41 static std::map<std::string, std::vector<std::string>> plurals 42 { 43 {"", {"", ""}}, 44 }; 45 46 std::shared_ptr<const i2p::i18n::Locale> GetLocale() 47 { 48 return std::make_shared<i2p::i18n::Locale>(language, rtl, strings, plurals, [] (int n)->int { return plural(n); }); 49 } 50 51 } // language 52 } // i18n 53 } // i2p