mirror of
https://github.com/PretendoNetwork/Inkay.git
synced 2026-04-18 15:07:26 -05:00
feat: Add translation for module not found errors
This commit is contained in:
parent
7958373394
commit
68bc066c7b
|
|
@ -35,6 +35,8 @@ struct config_strings {
|
|||
std::string_view need_menu_action;
|
||||
std::string_view using_nintendo_network;
|
||||
std::string_view using_pretendo_network;
|
||||
std::string_view module_not_found;
|
||||
std::string_view module_init_not_found;
|
||||
};
|
||||
|
||||
config_strings get_config_strings(nn::swkbd::LanguageType language);
|
||||
|
|
|
|||
|
|
@ -17,13 +17,23 @@
|
|||
#include "module.h"
|
||||
#include <coreinit/dynload.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "Notification.h"
|
||||
#include "utils/logger.h"
|
||||
#include "utils/sysconfig.h"
|
||||
|
||||
static OSDynLoad_Module module;
|
||||
static void (*moduleInitialize)(bool) = nullptr;
|
||||
static InkayStatus (*moduleGetStatus)() = nullptr;
|
||||
|
||||
static const char *get_module_not_found_message() {
|
||||
return get_config_strings(get_system_language()).module_not_found.data();
|
||||
}
|
||||
|
||||
static const char *get_module_init_not_found_message() {
|
||||
return get_config_strings(get_system_language()).module_init_not_found.data();
|
||||
}
|
||||
|
||||
void Inkay_Initialize(bool apply_patches) {
|
||||
if (module) {
|
||||
return;
|
||||
|
|
@ -31,13 +41,13 @@ void Inkay_Initialize(bool apply_patches) {
|
|||
|
||||
if (OSDynLoad_Acquire("inkay", &module) != OS_DYNLOAD_OK) {
|
||||
DEBUG_FUNCTION_LINE("Failed to acquire module");
|
||||
ShowNotification("Cannot find Inkay module. Ensure the Inkay module is properly installed");
|
||||
ShowNotification(get_module_not_found_message());
|
||||
return;
|
||||
}
|
||||
|
||||
if (OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_Initialize", reinterpret_cast<void * *>(&moduleInitialize)) != OS_DYNLOAD_OK) {
|
||||
DEBUG_FUNCTION_LINE("Failed to find initialization function");
|
||||
ShowNotification("Cannot find Inkay module initialization function. Ensure the Inkay module is properly installed");
|
||||
ShowNotification(get_module_init_not_found_message());
|
||||
OSDynLoad_Release(module);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ struct config_strings {
|
|||
std::string_view using_nintendo_network;
|
||||
std::string_view using_pretendo_network;
|
||||
std::string_view multiplayer_port_display;
|
||||
std::string_view module_not_found;
|
||||
std::string_view module_init_not_found;
|
||||
};
|
||||
|
||||
config_strings get_config_strings(nn::swkbd::LanguageType language);
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "Nur vom Wii U-Menü aus"
|
||||
,.using_nintendo_network = "Nutze Nintendo Network"
|
||||
,.using_pretendo_network = "Nutze Pretendo Network"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -9,3 +9,5 @@
|
|||
,.using_nintendo_network = "Using Nintendo Network"
|
||||
,.using_pretendo_network = "Using Pretendo Network"
|
||||
,.multiplayer_port_display = "Using UDP port {} for multiplayer"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action="Solo desde el Menú de Wii U"
|
||||
,.using_nintendo_network="Usando Nintendo Network"
|
||||
,.using_pretendo_network="Usando Pretendo Network"
|
||||
,.module_not_found="No se pudo encontrar el módulo Inkay. Confirme que el módulo Inkay está instalado correctamente"
|
||||
,.module_init_not_found="No se pudo inicializar el módulo Inkay. Confirme que el módulo Inkay está instalado correctamente"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "Depuis le menu Wii U seulement"
|
||||
,.using_nintendo_network = "Sur Nintendo Network"
|
||||
,.using_pretendo_network = "Sur Pretendo Network"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "Solo dal menu WiiU"
|
||||
,.using_nintendo_network = "Usando Nintendo Network"
|
||||
,.using_pretendo_network = "Usando Pretendo Network"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "WiiUメニューからのみ実行可能"
|
||||
,.using_nintendo_network = "ニンテンドーネットワークを使用中"
|
||||
,.using_pretendo_network = "Pretendoネットワークを使用中"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "Alleen vanuit het WiiU-menu"
|
||||
,.using_nintendo_network = "Nintendo Network wordt gebruikt"
|
||||
,.using_pretendo_network = "Pretendo Network wordt gebruikt"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "Apenas no menu do Wii U"
|
||||
,.using_nintendo_network = "Usando Nintendo Network"
|
||||
,.using_pretendo_network = "Usando Pretendo Network"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "Только из меню Wii U"
|
||||
,.using_nintendo_network = "Используется Nintendo Network"
|
||||
,.using_pretendo_network = "Используется Pretendo Network"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "仅来自WiiU Menu"
|
||||
,.using_nintendo_network = "使用 Nintendo Network"
|
||||
,.using_pretendo_network = "使用 Pretendo Network"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@
|
|||
,.need_menu_action = "僅來自WiiU Menu"
|
||||
,.using_nintendo_network = "使用 Nintendo Network"
|
||||
,.using_pretendo_network = "使用 Pretendo Network"
|
||||
,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed"
|
||||
,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user