diff --git a/po/ja_JP.po b/po/ja_JP.po index 571c99f..2acf4dd 100644 --- a/po/ja_JP.po +++ b/po/ja_JP.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Minemap\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 00:24-0500\n" -"PO-Revision-Date: 2024-01-12 00:27-0500\n" +"POT-Creation-Date: 2024-06-06 23:35-0400\n" +"PO-Revision-Date: 2024-06-06 23:46-0400\n" "Last-Translator: Tianhao Chai \n" "Language-Team: \n" "Language: ja_JP\n" @@ -22,104 +22,104 @@ msgstr "" "X-Poedit-Basepath: ../src\n" "X-Poedit-SearchPath-0: .\n" -#: constants.h:61 +#: constants.h:65 msgid "Invalid Minecraft Version Specifier" msgstr "無効な Minecraft バージョン指定子" -#: constants.h:63 +#: constants.h:67 msgid "No game version or invalid version specified" msgstr "ゲームバージョンがない、または無効なバージョンが指定された" -#: constants.h:64 +#: constants.h:68 msgid "No input file specified" msgstr "入力ファイルが指定されていません" -#: constants.h:65 +#: constants.h:69 msgid "No output file specified" msgstr "出力ファイルが指定されていません" -#: constants.h:66 +#: constants.h:70 msgid "Missing marker type / operation" msgstr "マーカーの種類や操作の欠落" -#: constants.h:68 +#: constants.h:72 msgid "Invalid argument passed: {}" msgstr "渡された引数が無効です:{}" -#: constants.h:69 +#: constants.h:73 msgid "Invalid position string" msgstr "無効な位置の文字列" -#: constants.h:70 +#: constants.h:74 msgid "Invalid banner specifier" msgstr "無効なバナー指定子" -#: constants.h:71 +#: constants.h:75 msgid "Coordinates out of range" msgstr "座標が範囲外" -#: constants.h:72 +#: constants.h:76 msgid "Cannot open input stream" msgstr "入力ストリームを開くことができません" -#: constants.h:73 +#: constants.h:77 msgid "Cannot parse input NBT file" -msgstr "入力された NBT ファイルをパースできません" +msgstr "入力 NBT ファイルを解析できません" -#: constants.h:74 +#: constants.h:78 msgid "" "Cannot parse NBT map file to modify - will generate from scratch and " "overwrite" -msgstr "変更する NBT 地図ファイルをパースできません - 生成して上書きします" +msgstr "変更する NBT 地図ファイルを解析できません - 生成して上書きします" -#: constants.h:76 +#: constants.h:80 msgid "" "The map data tag is not a compound but a {}. This file is probably not a map " "nbt." msgstr "" -"地図の data タグは compound ではなく、{} tag です。このファイルはおそらく地" -"図 nbt ではありません。" +"地図の \"data\" タグは compound ではなく、{} tag です。このファイルはおそらく" +"有効な地図 nbt ではありません。" -#: constants.h:77 +#: constants.h:81 msgid "Color data is not a byte array. This file is probably not a map nbt." msgstr "" -"カラーデータは byte array ではありません。このファイルはおそらく地図 nbt では" -"ありません。" +"カラーデータは byte array ではありません。このファイルはおそらく有効な地図 " +"nbt ではありません。" -#: constants.h:78 +#: constants.h:82 msgid "" "The map does not supports banners - update to a newer Minecraft version and " "try again" msgstr "" -"この地図はバナーには対応していません - 新しい Minecraft のバージョンにアップ" +"この地図はバナーには対応していません - 新しいバージョンの Minecraft にアップ" "デートして再度お試しください" -#: constants.h:79 +#: constants.h:83 msgid "Banners in this map is malformed" msgstr "この地図のバナーは不正です" -#: constants.h:80 +#: constants.h:84 msgid "Position coordinates in this marker is malformed" msgstr "このマーカーの位置座標が不正です" -#: constants.h:81 +#: constants.h:85 msgid "BUG: No color match for pixel at ({}, {}). Please submit a bug report." msgstr "" "BUG: ({}, {}) にあるピクセルの色が一致しない。不具合報告をお寄せください。" -#: constants.h:82 +#: constants.h:87 msgid "" "Warning: Had to render {} partially transparent pixels into fully " "transparent ones. Your output might look incorrect." msgstr "" -"警告:{} 個の部分透過ピクセルを完全透過ピクセルに変換する必要がありました。出" -"力が正しくないと思われるかもしれません。" +"警告:{} 個の部分透過ピクセルを完全透明になる必要がありました。出力が正しくな" +"いと思われるかもしれません。" -#: constants.h:83 -msgid "Color code {} at offset {} is out of range!" -msgstr "オフセット {1} のカラーコード {0} が範囲外です!" +#: constants.h:89 +msgid "Color code {:#x} at offset {} is out of range!" +msgstr "オフセット {1} のカラーコード {0:$x} が範囲外です!" -#: constants.h:87 +#: constants.h:94 msgid "" "Usage: minemap \n" "\t-d, --dithering\n" @@ -157,7 +157,7 @@ msgstr "" "\t\t必要、この地図が使用できる最小限のゲームバージョン\n" "\t\t以下の値から選択してください。\n" -#: constants.h:105 +#: constants.h:112 msgid "" "Usage: pamenim \n" "\t-i, --input INPUT\n" @@ -181,7 +181,7 @@ msgstr "" "\t\t必要、この地図がエクスポートされた Minecraft のゲームバージョン\n" "\t\t以下の値から選択してください。\n" -#: constants.h:117 +#: constants.h:124 msgid "" "Usage: minemarker [operation]\n" "Available operations:\n" @@ -198,11 +198,11 @@ msgid "" "\t\tOptional, indicates that the input file is uncompressed\n" msgstr "" -#: constants.h:132 +#: constants.h:138 msgid "\t\t\t{:>8} for game version from {} to {}\n" msgstr "\t\t\t{:>8} は {} から {} まで対応しています\n" -#: constants.h:133 +#: constants.h:139 msgid "" "\t\tOlder versions are not supported.\n" "\n" diff --git a/po/messages.pot b/po/messages.pot index 4c6e128..c80efdc 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Minemap\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 00:24-0500\n" +"POT-Creation-Date: 2024-06-06 23:35-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,87 +21,87 @@ msgstr "" "X-Poedit-Basepath: ../src\n" "X-Poedit-SearchPath-0: .\n" -#: constants.h:61 +#: constants.h:65 msgid "Invalid Minecraft Version Specifier" msgstr "" -#: constants.h:63 +#: constants.h:67 msgid "No game version or invalid version specified" msgstr "" -#: constants.h:64 +#: constants.h:68 msgid "No input file specified" msgstr "" -#: constants.h:65 +#: constants.h:69 msgid "No output file specified" msgstr "" -#: constants.h:66 +#: constants.h:70 msgid "Missing marker type / operation" msgstr "" -#: constants.h:68 +#: constants.h:72 msgid "Invalid argument passed: {}" msgstr "" -#: constants.h:69 +#: constants.h:73 msgid "Invalid position string" msgstr "" -#: constants.h:70 +#: constants.h:74 msgid "Invalid banner specifier" msgstr "" -#: constants.h:71 +#: constants.h:75 msgid "Coordinates out of range" msgstr "" -#: constants.h:72 +#: constants.h:76 msgid "Cannot open input stream" msgstr "" -#: constants.h:73 +#: constants.h:77 msgid "Cannot parse input NBT file" msgstr "" -#: constants.h:74 +#: constants.h:78 msgid "Cannot parse NBT map file to modify - will generate from scratch and overwrite" msgstr "" -#: constants.h:76 +#: constants.h:80 msgid "The map data tag is not a compound but a {}. This file is probably not a map nbt." msgstr "" -#: constants.h:77 +#: constants.h:81 msgid "Color data is not a byte array. This file is probably not a map nbt." msgstr "" -#: constants.h:78 +#: constants.h:82 msgid "The map does not supports banners - update to a newer Minecraft version and try again" msgstr "" -#: constants.h:79 +#: constants.h:83 msgid "Banners in this map is malformed" msgstr "" -#: constants.h:80 +#: constants.h:84 msgid "Position coordinates in this marker is malformed" msgstr "" -#: constants.h:81 +#: constants.h:85 msgid "BUG: No color match for pixel at ({}, {}). Please submit a bug report." msgstr "" -#: constants.h:82 +#: constants.h:87 msgid "Warning: Had to render {} partially transparent pixels into fully transparent ones. Your output might look incorrect." msgstr "" -#: constants.h:83 -msgid "Color code {} at offset {} is out of range!" +#: constants.h:89 +msgid "Color code {:#x} at offset {} is out of range!" msgstr "" -#: constants.h:87 +#: constants.h:94 msgid "" "Usage: minemap \n" "\t-d, --dithering\n" @@ -121,7 +121,7 @@ msgid "" "\t\tSelect from the following values: \n" msgstr "" -#: constants.h:105 +#: constants.h:112 msgid "" "Usage: pamenim \n" "\t-i, --input INPUT\n" @@ -135,7 +135,7 @@ msgid "" "\t\tSelect from the following values: \n" msgstr "" -#: constants.h:117 +#: constants.h:124 msgid "" "Usage: minemarker [operation]\n" "Available operations:\n" @@ -152,11 +152,11 @@ msgid "" "\t\tOptional, indicates that the input file is uncompressed\n" msgstr "" -#: constants.h:132 +#: constants.h:138 msgid "\t\t\t{:>8} for game version from {} to {}\n" msgstr "" -#: constants.h:133 +#: constants.h:139 msgid "" "\t\tOlder versions are not supported.\n" "\n" diff --git a/po/zh_CN.po b/po/zh_CN.po index c7902a9..4442263 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: minemap\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 00:24-0500\n" -"PO-Revision-Date: 2024-01-12 00:28-0500\n" +"POT-Creation-Date: 2024-06-06 23:36-0400\n" +"PO-Revision-Date: 2024-06-06 23:37-0400\n" "Last-Translator: Tianhao Chai \n" "Language-Team: \n" "Language: zh_CN\n" @@ -22,96 +22,96 @@ msgstr "" "X-Poedit-Basepath: ../src\n" "X-Poedit-SearchPath-0: .\n" -#: constants.h:61 +#: constants.h:65 msgid "Invalid Minecraft Version Specifier" msgstr "指定的 Minecraft 版本无效" -#: constants.h:63 +#: constants.h:67 msgid "No game version or invalid version specified" msgstr "未指定游戏版本号或指定了无效的版本号" -#: constants.h:64 +#: constants.h:68 msgid "No input file specified" msgstr "未指定输入文件" -#: constants.h:65 +#: constants.h:69 msgid "No output file specified" msgstr "未指定输出文件" -#: constants.h:66 +#: constants.h:70 msgid "Missing marker type / operation" msgstr "缺少图钉类型或要进行的操作" -#: constants.h:68 +#: constants.h:72 msgid "Invalid argument passed: {}" msgstr "传递的参数无效:{}" -#: constants.h:69 +#: constants.h:73 msgid "Invalid position string" msgstr "坐标无效" -#: constants.h:70 +#: constants.h:74 msgid "Invalid banner specifier" msgstr "横幅格式无效" -#: constants.h:71 +#: constants.h:75 msgid "Coordinates out of range" msgstr "坐标超出有效范围" -#: constants.h:72 +#: constants.h:76 msgid "Cannot open input stream" msgstr "无法打开输入数据流" -#: constants.h:73 +#: constants.h:77 msgid "Cannot parse input NBT file" msgstr "无法解析输入 NBT 文件" -#: constants.h:74 +#: constants.h:78 msgid "" "Cannot parse NBT map file to modify - will generate from scratch and " "overwrite" msgstr "无法解析要修改的 NBT 地图文件 - 将重新生成并覆盖" -#: constants.h:76 +#: constants.h:80 msgid "" "The map data tag is not a compound but a {}. This file is probably not a map " "nbt." msgstr "地图 data 标签不是 compound 而是 {}。此文件可能不是地图 NBT。" -#: constants.h:77 +#: constants.h:81 msgid "Color data is not a byte array. This file is probably not a map nbt." msgstr "颜色数据不是字节数组。此文件可能不是地图 NBT。" -#: constants.h:78 +#: constants.h:82 msgid "" "The map does not supports banners - update to a newer Minecraft version and " "try again" msgstr "此地图文件不支持放置横幅图钉 - 请更新 Minecraft 版本后重试" -#: constants.h:79 +#: constants.h:83 msgid "Banners in this map is malformed" msgstr "此地图文件中的横幅图钉格式不正确" -#: constants.h:80 +#: constants.h:84 msgid "Position coordinates in this marker is malformed" msgstr "此图钉的坐标格式不正确" -#: constants.h:81 +#: constants.h:85 msgid "BUG: No color match for pixel at ({}, {}). Please submit a bug report." msgstr "BUG:无法找到与 ({}, {}) 匹配的色表编码。请提交 BUG 报告。" -#: constants.h:82 +#: constants.h:87 msgid "" "Warning: Had to render {} partially transparent pixels into fully " "transparent ones. Your output might look incorrect." msgstr "" "警告:被迫将 {} 个半透明像素渲染为全透明像素。您的输出看起来可能不正确。" -#: constants.h:83 -msgid "Color code {} at offset {} is out of range!" -msgstr "位于 {1} 的色表编码 {0} 在有效范围外!" +#: constants.h:89 +msgid "Color code {:#x} at offset {} is out of range!" +msgstr "位于 {1} 的色表编码 {0:#x} 在有效范围外!" -#: constants.h:87 +#: constants.h:94 msgid "" "Usage: minemap \n" "\t-d, --dithering\n" @@ -148,7 +148,7 @@ msgstr "" "\t\t必需,该地图可用于的最小游戏版本\n" "\t\t可从以下值选择:\n" -#: constants.h:105 +#: constants.h:112 msgid "" "Usage: pamenim \n" "\t-i, --input INPUT\n" @@ -172,7 +172,7 @@ msgstr "" "\t\t必需,此地图所在存档的 Minecraft 版本\n" "\t\t可从以下值选择:\n" -#: constants.h:117 +#: constants.h:124 msgid "" "Usage: minemarker [operation]\n" "Available operations:\n" @@ -189,11 +189,11 @@ msgid "" "\t\tOptional, indicates that the input file is uncompressed\n" msgstr "" -#: constants.h:132 +#: constants.h:138 msgid "\t\t\t{:>8} for game version from {} to {}\n" msgstr "\t\t\t{:>8} 可用于游戏版本 {} 到 {}\n" -#: constants.h:133 +#: constants.h:139 msgid "" "\t\tOlder versions are not supported.\n" "\n" diff --git a/src/constants.h b/src/constants.h index c356633..0ba9a73 100644 --- a/src/constants.h +++ b/src/constants.h @@ -86,7 +86,7 @@ inline void initializeLocale() { #define COLOR_PARTIALLY_TRANSPARENT \ _("Warning: Had to render {} partially transparent pixels into fully transparent ones. Your output might look " \ "incorrect.") -#define COLOR_OUT_OF_RANGE _("Color code {} at offset {} is out of range!") +#define COLOR_OUT_OF_RANGE _("Color code {:#x} at offset {} is out of range!") /* Usage Text */ diff --git a/src/libminemap.cpp b/src/libminemap.cpp index be8a1c4..7b8548d 100644 --- a/src/libminemap.cpp +++ b/src/libminemap.cpp @@ -78,11 +78,11 @@ namespace Minemap { auto pixel_store = std::make_unique>(); auto pixel_array = pixel_store->data(); for (int i = 0; i < 16384; i++) { - MapColorCode colorIndex = ((NBTP::ByteTag *) colors_list[i].get())->getPayload(); + MapColorCode colorIndex = (dynamic_cast(colors_list[i].get())->getPayload()); auto rgb = palette_lookup_table->lookup(colorIndex); if (!rgb.has_value()) { - std::string error_string = localizedFormat(COLOR_OUT_OF_RANGE, (uint16_t) colorIndex, i); + std::string error_string = localizedFormat(COLOR_OUT_OF_RANGE, colorIndex, i); throw std::runtime_error(error_string); }