From d6810e36b643c15c34f6082a39b4b186c33ad021 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Fri, 4 Mar 2022 12:08:06 +0600 Subject: [PATCH] Show translator name in credits page --- resource/common/locale/English.json | 1 + src/locale.cpp | 4 ++-- src/locale.h | 2 +- src/menu.cpp | 6 ++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/resource/common/locale/English.json b/resource/common/locale/English.json index 008b69d..877a811 100644 --- a/resource/common/locale/English.json +++ b/resource/common/locale/English.json @@ -98,6 +98,7 @@ "WeatherIDText": "Sets weather by IDs (0-255). Don't touch unless you know what you're doing!" }, "Main": { + "Translator" : "Translator", "TranslationLanguage": "English", "TranslationLanguageDisclaimer": "Translated to English by Grinch_", "TranslatorName": "Grinch_" diff --git a/src/locale.cpp b/src/locale.cpp index 2351e78..44037a7 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -2,7 +2,7 @@ #include "locale.h" #include -Locale::eReturnCodes Locale::Init(const char* path, const char* def, const char* callback) +Locale::eReturnCodes Locale::Init(const char* path, const char* def, const char* fallback) { std::string localePath = path; if (localePath.back() != '/') @@ -42,7 +42,7 @@ Locale::eReturnCodes Locale::Init(const char* path, const char* def, const char* #endif m_locales.push_back(fileName); - if (!strcmp(callback, fileName.c_str())) + if (!strcmp(fallback, fileName.c_str())) { std::string localePath = m_path + fileName + ".json"; diff --git a/src/locale.h b/src/locale.h index 38454b7..c3c7a4a 100644 --- a/src/locale.h +++ b/src/locale.h @@ -36,7 +36,7 @@ public: Loads json files from the locale directory Calling it multiple times will unload previous data */ - static eReturnCodes Init(const char* path, const char* def = "English", const char* callback = ""); + static eReturnCodes Init(const char* path, const char* def = "English", const char* fallback = ""); // Returns a vector of available languages static std::vector& GetLocaleList(); diff --git a/src/menu.cpp b/src/menu.cpp index f447aa1..8d02a14 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -671,6 +671,12 @@ void Menu::ShowPage() ImGui::Text("TsudaKageyu"); ImGui::TableNextColumn(); ImGui::Text("MinHook"); + + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::Text(TEXT("Menu.TranslatorName")); + ImGui::TableNextColumn(); + ImGui::Text(TEXT("Menu.Translator")); ImGui::EndTable(); }