From f1ec2ef0c47ad265b4491d1fa1f543219a3211fa Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 9 Aug 2022 08:38:41 +0200 Subject: [PATCH] lang: Added some unlocalized values --- .../source/content/views/view_pattern_editor.cpp | 14 +++++++------- plugins/builtin/source/lang/de_DE.cpp | 1 + plugins/builtin/source/lang/en_US.cpp | 1 + plugins/builtin/source/lang/it_IT.cpp | 1 + plugins/builtin/source/lang/ja_JP.cpp | 1 + plugins/builtin/source/lang/pt_BR.cpp | 1 + plugins/builtin/source/lang/zh_CN.cpp | 1 + plugins/builtin/source/lang/zh_TW.cpp | 1 + plugins/builtin/source/pattern_drawer.cpp | 2 +- 9 files changed, 15 insertions(+), 8 deletions(-) diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 51745ce6d..ea90507cc 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -715,32 +715,32 @@ namespace hex::plugin::builtin { ImGui::TableNextRow(); ImGui::TableNextColumn(); - ImGui::TextFormatted("Type: "); + ImGui::TextFormatted("{}: ", "hex.builtin.common.type"_lang); ImGui::TableNextColumn(); ImGui::TextFormatted("{}", pattern->getTypeName()); ImGui::TableNextRow(); ImGui::TableNextColumn(); - ImGui::TextFormatted("Address: "); + ImGui::TextFormatted("{}: ", "hex.builtin.common.address"_lang); ImGui::TableNextColumn(); ImGui::TextFormatted("0x{:08X}", pattern->getOffset()); ImGui::TableNextRow(); ImGui::TableNextColumn(); - ImGui::TextFormatted("Size: "); + ImGui::TextFormatted("{}: ", "hex.builtin.common.size"_lang); ImGui::TableNextColumn(); - ImGui::TextFormatted("{} {}", pattern->getSize(), pattern->getSize() > 1 ? "Bytes" : "Byte"); + ImGui::TextFormatted("{}", hex::toByteString(pattern->getSize())); ImGui::TableNextRow(); ImGui::TableNextColumn(); - ImGui::TextFormatted("Endian: "); + ImGui::TextFormatted("{}: ", "hex.builtin.common.endian"_lang); ImGui::TableNextColumn(); - ImGui::TextFormatted("{}", pattern->getEndian() == std::endian::little ? "Little" : "Big"); + ImGui::TextFormatted("{}", pattern->getEndian() == std::endian::little ? "hex.builtin.common.little"_lang : "hex.builtin.common.big"_lang); if (const auto &comment = pattern->getComment(); comment.has_value()) { ImGui::TableNextRow(); ImGui::TableNextColumn(); - ImGui::TextFormatted("Comment: "); + ImGui::TextFormatted("{}: ", "hex.builtin.common.comment"_lang); ImGui::TableNextColumn(); ImGui::TextWrapped("\"%s\"", pattern->getComment()->c_str()); } diff --git a/plugins/builtin/source/lang/de_DE.cpp b/plugins/builtin/source/lang/de_DE.cpp index 83864b479..1e06db8e5 100644 --- a/plugins/builtin/source/lang/de_DE.cpp +++ b/plugins/builtin/source/lang/de_DE.cpp @@ -87,6 +87,7 @@ namespace hex::plugin::builtin { { "hex.builtin.common.range", "Bereich" }, { "hex.builtin.common.range.entire_data", "Gesammte Daten" }, { "hex.builtin.common.range.selection", "Selektion" }, + { "hex.builtin.common.comment", "Kommentar" }, { "hex.builtin.common.encoding.ascii", "ASCII" }, { "hex.builtin.common.encoding.utf16le", "UTF-16LE" }, diff --git a/plugins/builtin/source/lang/en_US.cpp b/plugins/builtin/source/lang/en_US.cpp index 94a500651..0b581aefa 100644 --- a/plugins/builtin/source/lang/en_US.cpp +++ b/plugins/builtin/source/lang/en_US.cpp @@ -89,6 +89,7 @@ namespace hex::plugin::builtin { { "hex.builtin.common.range", "Range" }, { "hex.builtin.common.range.entire_data", "Entire Data" }, { "hex.builtin.common.range.selection", "Selection" }, + { "hex.builtin.common.comment", "Comment" }, { "hex.builtin.common.encoding.ascii", "ASCII" }, { "hex.builtin.common.encoding.utf16le", "UTF-16LE" }, diff --git a/plugins/builtin/source/lang/it_IT.cpp b/plugins/builtin/source/lang/it_IT.cpp index ba2120fb8..63e8fa29a 100644 --- a/plugins/builtin/source/lang/it_IT.cpp +++ b/plugins/builtin/source/lang/it_IT.cpp @@ -87,6 +87,7 @@ namespace hex::plugin::builtin { //{ "hex.builtin.common.range", "Range" }, //{ "hex.builtin.common.range.entire_data", "Entire Data" }, //{ "hex.builtin.common.range.selection", "Selection" }, + //{ "hex.builtin.common.comment", "Comment" }, { "hex.builtin.common.encoding.ascii", "ASCII" }, { "hex.builtin.common.encoding.utf16le", "UTF-16LE" }, diff --git a/plugins/builtin/source/lang/ja_JP.cpp b/plugins/builtin/source/lang/ja_JP.cpp index 0bbb0de0e..45c8defb0 100644 --- a/plugins/builtin/source/lang/ja_JP.cpp +++ b/plugins/builtin/source/lang/ja_JP.cpp @@ -87,6 +87,7 @@ namespace hex::plugin::builtin { //{ "hex.builtin.common.range", "Range" }, //{ "hex.builtin.common.range.entire_data", "Entire Data" }, //{ "hex.builtin.common.range.selection", "Selection" }, + //{ "hex.builtin.common.comment", "Comment" }, { "hex.builtin.common.encoding.ascii", "ASCII" }, { "hex.builtin.common.encoding.utf16le", "UTF-16LE" }, diff --git a/plugins/builtin/source/lang/pt_BR.cpp b/plugins/builtin/source/lang/pt_BR.cpp index d32907595..da6cbd5ce 100644 --- a/plugins/builtin/source/lang/pt_BR.cpp +++ b/plugins/builtin/source/lang/pt_BR.cpp @@ -87,6 +87,7 @@ namespace hex::plugin::builtin { //{ "hex.builtin.common.range", "Range" }, //{ "hex.builtin.common.range.entire_data", "Entire Data" }, //{ "hex.builtin.common.range.selection", "Selection" }, + //{ "hex.builtin.common.comment", "Comment" }, { "hex.builtin.common.encoding.ascii", "ASCII" }, { "hex.builtin.common.encoding.utf16le", "UTF-16LE" }, diff --git a/plugins/builtin/source/lang/zh_CN.cpp b/plugins/builtin/source/lang/zh_CN.cpp index 3ab522350..427b6840a 100644 --- a/plugins/builtin/source/lang/zh_CN.cpp +++ b/plugins/builtin/source/lang/zh_CN.cpp @@ -87,6 +87,7 @@ namespace hex::plugin::builtin { //{ "hex.builtin.common.range", "Range" }, //{ "hex.builtin.common.range.entire_data", "Entire Data" }, //{ "hex.builtin.common.range.selection", "Selection" }, + //{ "hex.builtin.common.comment", "Comment" }, { "hex.builtin.common.encoding.ascii", "ASCII" }, { "hex.builtin.common.encoding.utf16le", "UTF-16LE" }, diff --git a/plugins/builtin/source/lang/zh_TW.cpp b/plugins/builtin/source/lang/zh_TW.cpp index 615f0162b..6f6414ea0 100644 --- a/plugins/builtin/source/lang/zh_TW.cpp +++ b/plugins/builtin/source/lang/zh_TW.cpp @@ -87,6 +87,7 @@ namespace hex::plugin::builtin { //{ "hex.builtin.common.range", "Range" }, //{ "hex.builtin.common.range.entire_data", "Entire Data" }, //{ "hex.builtin.common.range.selection", "Selection" }, + //{ "hex.builtin.common.comment", "Comment" }, { "hex.builtin.common.encoding.ascii", "ASCII" }, { "hex.builtin.common.encoding.utf16le", "UTF-16LE" }, diff --git a/plugins/builtin/source/pattern_drawer.cpp b/plugins/builtin/source/pattern_drawer.cpp index 1f1a27599..d7fd6c863 100644 --- a/plugins/builtin/source/pattern_drawer.cpp +++ b/plugins/builtin/source/pattern_drawer.cpp @@ -55,7 +55,7 @@ namespace hex { auto byteAddr = pattern.getOffset() + pattern.getBitOffset() / 8; auto firstBitIdx = pattern.getBitOffset() % 8; - auto lastBitIdx = firstBitIdx + (pattern.getBitSize() - 1) % 8; + auto lastBitIdx = firstBitIdx + (pattern.getBitSize() - 1); if (firstBitIdx == lastBitIdx) ImGui::TextFormatted("0x{0:08X} bit {1}", byteAddr, firstBitIdx); else