mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
lang: Updated localization system to use a more versatile json format
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization.hpp>
|
||||
|
||||
namespace hex::plugin::windows {
|
||||
|
||||
void registerLanguageDeDE() {
|
||||
ContentRegistry::Language::addLocalizations("de-DE", {
|
||||
{ "hex.windows.title_bar_button.feedback", "Feedback hinterlassen" },
|
||||
{ "hex.windows.title_bar_button.debug_build", "Debug build"},
|
||||
|
||||
{ "hex.windows.view.tty_console.name", "TTY Konsole" },
|
||||
{ "hex.windows.view.tty_console.config", "Konfiguration"},
|
||||
{ "hex.windows.view.tty_console.port", "Port" },
|
||||
{ "hex.windows.view.tty_console.reload", "Neu Laden" },
|
||||
{ "hex.windows.view.tty_console.baud", "Baudrate" },
|
||||
{ "hex.windows.view.tty_console.num_bits", "Datenbits" },
|
||||
{ "hex.windows.view.tty_console.stop_bits", "Stoppbits" },
|
||||
{ "hex.windows.view.tty_console.parity_bits", "Paritätsbit" },
|
||||
{ "hex.windows.view.tty_console.cts", "CTS flow control benutzen" },
|
||||
{ "hex.windows.view.tty_console.connect", "Verbinden" },
|
||||
{ "hex.windows.view.tty_console.disconnect", "Trennen" },
|
||||
{ "hex.windows.view.tty_console.connect_error", "Verbindung mit COM Port fehlgeschlagen!" },
|
||||
{ "hex.windows.view.tty_console.no_available_port", "Kein valider COM port wurde ausgewählt oder keiner ist verfügbar!" },
|
||||
{ "hex.windows.view.tty_console.clear", "Löschen" },
|
||||
{ "hex.windows.view.tty_console.auto_scroll", "Auto scroll" },
|
||||
{ "hex.windows.view.tty_console.console", "Konsole" },
|
||||
{ "hex.windows.view.tty_console.send_etx", "ETX Senden" },
|
||||
{ "hex.windows.view.tty_console.send_eot", "EOT Senden" },
|
||||
{ "hex.windows.view.tty_console.send_sub", "SUB Senden" },
|
||||
|
||||
{ "hex.builtin.setting.general.context_menu_entry", "Windows Kontextmenu-Eintrag" },
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization.hpp>
|
||||
|
||||
namespace hex::plugin::windows {
|
||||
|
||||
void registerLanguageEnUS() {
|
||||
ContentRegistry::Language::addLocalizations("en-US", {
|
||||
{ "hex.windows.title_bar_button.feedback", "Leave Feedback" },
|
||||
{ "hex.windows.title_bar_button.debug_build", "Debug build"},
|
||||
|
||||
{ "hex.windows.view.tty_console.name", "TTY Console" },
|
||||
{ "hex.windows.view.tty_console.config", "Configuration"},
|
||||
{ "hex.windows.view.tty_console.port", "Port" },
|
||||
{ "hex.windows.view.tty_console.reload", "Reload" },
|
||||
{ "hex.windows.view.tty_console.baud", "Baud rate" },
|
||||
{ "hex.windows.view.tty_console.num_bits", "Data bits" },
|
||||
{ "hex.windows.view.tty_console.stop_bits", "Stop bits" },
|
||||
{ "hex.windows.view.tty_console.parity_bits", "Parity bit" },
|
||||
{ "hex.windows.view.tty_console.cts", "Use CTS flow control" },
|
||||
{ "hex.windows.view.tty_console.connect", "Connect" },
|
||||
{ "hex.windows.view.tty_console.disconnect", "Disconnect" },
|
||||
{ "hex.windows.view.tty_console.connect_error", "Failed to connect to COM Port!" },
|
||||
{ "hex.windows.view.tty_console.no_available_port", "No valid COM port is selected or no COM port is available!" },
|
||||
{ "hex.windows.view.tty_console.clear", "Clear" },
|
||||
{ "hex.windows.view.tty_console.auto_scroll", "Auto scroll" },
|
||||
{ "hex.windows.view.tty_console.console", "Console" },
|
||||
{ "hex.windows.view.tty_console.send_etx", "Send ETX" },
|
||||
{ "hex.windows.view.tty_console.send_eot", "Send EOT" },
|
||||
{ "hex.windows.view.tty_console.send_sub", "Send SUB" },
|
||||
|
||||
{ "hex.builtin.setting.general.context_menu_entry", "Windows context menu entry" },
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization.hpp>
|
||||
|
||||
namespace hex::plugin::windows {
|
||||
|
||||
void registerLanguageKoKR() {
|
||||
ContentRegistry::Language::addLocalizations("ko-KR", {
|
||||
{ "hex.windows.title_bar_button.feedback", "피드백 남기기" },
|
||||
{ "hex.windows.title_bar_button.debug_build", "디버그 빌드"},
|
||||
|
||||
{ "hex.windows.view.tty_console.name", "TTY 콘솔" },
|
||||
{ "hex.windows.view.tty_console.config", "설정"},
|
||||
{ "hex.windows.view.tty_console.port", "포트" },
|
||||
{ "hex.windows.view.tty_console.reload", "새로 고침" },
|
||||
{ "hex.windows.view.tty_console.baud", "Baud rate" },
|
||||
{ "hex.windows.view.tty_console.num_bits", "Data bits" },
|
||||
{ "hex.windows.view.tty_console.stop_bits", "Stop bits" },
|
||||
{ "hex.windows.view.tty_console.parity_bits", "Parity bit" },
|
||||
{ "hex.windows.view.tty_console.cts", "Use CTS flow control" },
|
||||
{ "hex.windows.view.tty_console.connect", "연결" },
|
||||
{ "hex.windows.view.tty_console.disconnect", "연결 끊기" },
|
||||
{ "hex.windows.view.tty_console.connect_error", "COM 포트 연결에 실패했습니다!" },
|
||||
{ "hex.windows.view.tty_console.no_available_port", "선택한 COM 포트가 올바르지 않거나 COM 포트가 존재하지 않습니다!" },
|
||||
{ "hex.windows.view.tty_console.clear", "지우기" },
|
||||
{ "hex.windows.view.tty_console.auto_scroll", "자동 스크롤" },
|
||||
{ "hex.windows.view.tty_console.console", "콘솔" },
|
||||
{ "hex.windows.view.tty_console.send_etx", "ETX 보내기" },
|
||||
{ "hex.windows.view.tty_console.send_eot", "EOT 보내기" },
|
||||
{ "hex.windows.view.tty_console.send_sub", "SUB 보내기" },
|
||||
|
||||
{ "hex.builtin.setting.general.context_menu_entry", "Windows 컨텍스트 메뉴 항목" },
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization.hpp>
|
||||
|
||||
namespace hex::plugin::windows {
|
||||
|
||||
void registerLanguagePtBR() {
|
||||
ContentRegistry::Language::addLocalizations("pt-BR", {
|
||||
{ "hex.windows.title_bar_button.feedback", "Deixar Feedback" },
|
||||
{ "hex.windows.title_bar_button.debug_build", "Compilação de depuração"},
|
||||
|
||||
{ "hex.windows.view.tty_console.name", "TTY Console" },
|
||||
{ "hex.windows.view.tty_console.config", "Configuração"},
|
||||
{ "hex.windows.view.tty_console.port", "Porta" },
|
||||
{ "hex.windows.view.tty_console.reload", "Recarregar" },
|
||||
{ "hex.windows.view.tty_console.baud", "Baud rate" },
|
||||
{ "hex.windows.view.tty_console.num_bits", "Data bits" },
|
||||
{ "hex.windows.view.tty_console.stop_bits", "Stop bits" },
|
||||
{ "hex.windows.view.tty_console.parity_bits", "Parity bit" },
|
||||
{ "hex.windows.view.tty_console.cts", "Usar o controle de fluxo CTS" },
|
||||
{ "hex.windows.view.tty_console.connect", "Conectar" },
|
||||
{ "hex.windows.view.tty_console.disconnect", "Desconectar" },
|
||||
{ "hex.windows.view.tty_console.connect_error", "Falha ao conectar à porta COM!" },
|
||||
{ "hex.windows.view.tty_console.no_available_port", "Nenhuma porta COM válida está selecionada ou nenhuma porta COM está disponível!" },
|
||||
{ "hex.windows.view.tty_console.clear", "Limpar" },
|
||||
{ "hex.windows.view.tty_console.auto_scroll", "Auto rolagem" },
|
||||
{ "hex.windows.view.tty_console.console", "Console" },
|
||||
{ "hex.windows.view.tty_console.send_etx", "Enviar ETX" },
|
||||
{ "hex.windows.view.tty_console.send_eot", "Enviar EOT" },
|
||||
{ "hex.windows.view.tty_console.send_sub", "Enviar SUB" },
|
||||
|
||||
{ "hex.builtin.setting.general.context_menu_entry", "Entrada do menu de contexto do Windows" },
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization.hpp>
|
||||
|
||||
namespace hex::plugin::windows {
|
||||
|
||||
void registerLanguageZhCN() {
|
||||
ContentRegistry::Language::addLocalizations("zh-CN", {
|
||||
{ "hex.windows.title_bar_button.feedback", "反馈" },
|
||||
{ "hex.windows.title_bar_button.debug_build", "调试构建"},
|
||||
|
||||
{ "hex.windows.view.tty_console.name", "TTY 控制台" },
|
||||
{ "hex.windows.view.tty_console.config", "配置"},
|
||||
{ "hex.windows.view.tty_console.port", "端口" },
|
||||
{ "hex.windows.view.tty_console.reload", "刷新" },
|
||||
{ "hex.windows.view.tty_console.baud", "波特率" },
|
||||
{ "hex.windows.view.tty_console.num_bits", "数据位" },
|
||||
{ "hex.windows.view.tty_console.stop_bits", "终止位" },
|
||||
{ "hex.windows.view.tty_console.parity_bits", "奇偶校验位" },
|
||||
{ "hex.windows.view.tty_console.cts", "使用 CTS 流控制" },
|
||||
{ "hex.windows.view.tty_console.connect", "连接" },
|
||||
{ "hex.windows.view.tty_console.disconnect", "断开" },
|
||||
{ "hex.windows.view.tty_console.connect_error", "无法连接到 COM 端口!" },
|
||||
{ "hex.windows.view.tty_console.no_available_port", "未选择有效的 COM 端口或无可用 COM 端口!" },
|
||||
{ "hex.windows.view.tty_console.clear", "清除" },
|
||||
{ "hex.windows.view.tty_console.auto_scroll", "自动滚动" },
|
||||
{ "hex.windows.view.tty_console.console", "控制台" },
|
||||
{ "hex.windows.view.tty_console.send_etx", "发送 ETX" },
|
||||
{ "hex.windows.view.tty_console.send_eot", "发送 EOT" },
|
||||
{ "hex.windows.view.tty_console.send_sub", "发送 SUB" },
|
||||
|
||||
{ "hex.builtin.setting.general.context_menu_entry", "窗口上下文菜单项" },
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization.hpp>
|
||||
|
||||
namespace hex::plugin::windows {
|
||||
|
||||
void registerLanguageZhTW() {
|
||||
ContentRegistry::Language::addLocalizations("zh-TW", {
|
||||
{ "hex.windows.title_bar_button.feedback", "意見回饋" },
|
||||
{ "hex.windows.title_bar_button.debug_build", "除錯組建"},
|
||||
|
||||
{ "hex.windows.view.tty_console.name", "TTY 終端機" },
|
||||
{ "hex.windows.view.tty_console.config", "設定"},
|
||||
{ "hex.windows.view.tty_console.port", "連接埠" },
|
||||
{ "hex.windows.view.tty_console.reload", "重新載入" },
|
||||
{ "hex.windows.view.tty_console.baud", "鮑率" },
|
||||
{ "hex.windows.view.tty_console.num_bits", "資料位元" },
|
||||
{ "hex.windows.view.tty_console.stop_bits", "停止位元" },
|
||||
{ "hex.windows.view.tty_console.parity_bits", "同位位元" },
|
||||
{ "hex.windows.view.tty_console.cts", "使用 CTS 流量控制" },
|
||||
{ "hex.windows.view.tty_console.connect", "連接" },
|
||||
{ "hex.windows.view.tty_console.disconnect", "斷開連接" },
|
||||
{ "hex.windows.view.tty_console.connect_error", "無法連接至 COM 連接埠!" },
|
||||
{ "hex.windows.view.tty_console.no_available_port", "未選取有效的 COM 連接埠或無可用的 COM 連接埠!" },
|
||||
{ "hex.windows.view.tty_console.clear", "清除" },
|
||||
{ "hex.windows.view.tty_console.auto_scroll", "自動捲動" },
|
||||
{ "hex.windows.view.tty_console.console", "終端機" },
|
||||
{ "hex.windows.view.tty_console.send_etx", "傳送 ETX" },
|
||||
{ "hex.windows.view.tty_console.send_eot", "傳送 EOT" },
|
||||
{ "hex.windows.view.tty_console.send_sub", "傳送 SUB" },
|
||||
|
||||
{ "hex.builtin.setting.general.context_menu_entry", "視窗內容功能表項目" },
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <romfs/romfs.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "views/view_tty_console.hpp"
|
||||
@@ -10,13 +11,6 @@ using namespace hex;
|
||||
|
||||
namespace hex::plugin::windows {
|
||||
|
||||
void registerLanguageEnUS();
|
||||
void registerLanguageDeDE();
|
||||
void registerLanguageZhCN();
|
||||
void registerLanguagePtBR();
|
||||
void registerLanguageZhTW();
|
||||
void registerLanguageKoKR();
|
||||
|
||||
void addFooterItems();
|
||||
void addTitleBarButtons();
|
||||
void registerSettings();
|
||||
@@ -63,13 +57,9 @@ static void checkBorderlessWindowOverride() {
|
||||
IMHEX_PLUGIN_SETUP("Windows", "WerWolv", "Windows-only features") {
|
||||
using namespace hex::plugin::windows;
|
||||
|
||||
registerLanguageEnUS();
|
||||
registerLanguageDeDE();
|
||||
registerLanguageZhCN();
|
||||
registerLanguagePtBR();
|
||||
registerLanguageZhTW();
|
||||
registerLanguageKoKR();
|
||||
|
||||
for (auto &path : romfs::list("lang"))
|
||||
hex::ContentRegistry::Language::addLocalization(nlohmann::json::parse(romfs::get(path).string()));
|
||||
|
||||
hex::ContentRegistry::Views::add<ViewTTYConsole>();
|
||||
|
||||
addFooterItems();
|
||||
|
||||
Reference in New Issue
Block a user