-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from tmarenko/multilang
multi language support
- Loading branch information
Showing
9 changed files
with
179 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[config] | ||
# available: chi_sim, chi_tra, eng, kor, jpn, spa, fra, rus, tha, vie, deu, ind, por | ||
language=eng | ||
|
||
[genshin_window_name] | ||
genshin_chi_sim=原神 | ||
genshin_chi_tra=原神 | ||
genshin_eng=Genshin Impact | ||
genshin_kor=원신 | ||
genshin_jpn=原神 | ||
genshin_spa=Genshin Impact | ||
genshin_fra=Genshin Impact | ||
genshin_rus=Genshin Impact | ||
genshin_tha=Genshin Impact | ||
genshin_vie=Genshin Impact | ||
genshin_deu=Genshin Impact | ||
genshin_ind=Genshin Impact | ||
genshin_por=Genshin Impact | ||
|
||
[paimon_name] | ||
paimon_chi_sim=派蒙 | ||
paimon_chi_tra=派蒙 | ||
paimon_eng=Paimon | ||
paimon_kor=폐이몬 | ||
paimon_jpn=バイモン | ||
paimon_spa=Paimon | ||
paimon_fra=Paimon | ||
paimon_rus=Паймон | ||
paimon_tha=Paimon | ||
paimon_vie=Paimon | ||
paimon_deu=Paimon | ||
paimon_ind=Paimon | ||
paimon_por=Paimon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "config.h" | ||
|
||
|
||
std::map<std::string, std::string> ParseConfig(const std::string &fileName) { | ||
std::map<std::string, std::string> configMap = { | ||
{"language", "eng"}, | ||
{"genshin_eng", "Genshin Impact"}, | ||
{"paimon_eng", "Paimon"} | ||
}; | ||
std::ifstream file(fileName); | ||
if (file.is_open()) { | ||
std::string line; | ||
while (std::getline(file, line)) { | ||
std::istringstream is_line(line); | ||
std::string key; | ||
if (std::getline(is_line, key, '=')) { | ||
std::string value; | ||
if (std::getline(is_line, value)) { | ||
configMap[key] = value; | ||
} | ||
} | ||
} | ||
} | ||
return configMap; | ||
} | ||
|
||
std::wstring convertStringToWstring(std::string &input) { | ||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter; | ||
return converter.from_bytes(input); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef GENSHINIMPACT_PAIMONSHUTUP_CONFIG_H | ||
#define GENSHINIMPACT_PAIMONSHUTUP_CONFIG_H | ||
|
||
#include <fstream> | ||
#include <sstream> | ||
#include <map> | ||
#include <codecvt> | ||
|
||
std::map<std::string, std::string> ParseConfig(const std::string &fileName); | ||
std::wstring convertStringToWstring(std::string &input); | ||
|
||
#endif //GENSHINIMPACT_PAIMONSHUTUP_CONFIG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.