refactor: use metaglot to enable i18n for Windows artifact

This commit is contained in:
2026-09-22 13:53:16 +08:00
parent f946247d1d
commit 447a6b45af
22 changed files with 519 additions and 83 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

+72
View File
@@ -0,0 +1,72 @@
// Generated by MetaGlot. DO NOT EDIT.
// Sources: dist/pineapple-pictures.rc.in.toml, locales/winrc/*.po (CMake placeholders are substituted later).
#pragma code_page(65001)
// ---------------------------------------------------------------------------
// Icon resources (referenced from the registry as "<exe path>,-<id>")
// ---------------------------------------------------------------------------
101 ICON "@CMAKE_CURRENT_SOURCE_DIR@/dist/embeds/app.ico" // app
102 ICON "@CMAKE_CURRENT_SOURCE_DIR@/dist/embeds/bmp.ico" // bmp
103 ICON "@CMAKE_CURRENT_SOURCE_DIR@/dist/embeds/gif.ico" // gif
104 ICON "@CMAKE_CURRENT_SOURCE_DIR@/dist/embeds/jpg.ico" // jpg
105 ICON "@CMAKE_CURRENT_SOURCE_DIR@/dist/embeds/png.ico" // png
// ---------------------------------------------------------------------------
// String tables (file type descriptions, referenced as "@<exe path>,-<id>")
// ---------------------------------------------------------------------------
{% for lang in languages -%}
// {{ lang.name }}
LANGUAGE {{ lang.primary }}, {{ lang.sublanguage }}
STRINGTABLE
BEGIN
{%- for i in (1000..1028) -%}
{% assign key = i | to_string %}
{{ i }} "{{ lang.strings[key] | rc_escape }}"
{%- endfor %}
END
{% endfor -%}
// ---------------------------------------------------------------------------
// Version information (one VERSIONINFO resource per language; Windows picks by resource language)
// ---------------------------------------------------------------------------
{% for lang in languages -%}
LANGUAGE {{ lang.primary }}, {{ lang.sublanguage }}
1 VERSIONINFO
FILEVERSION @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0
PRODUCTVERSION @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L // VOS_NT_WINDOWS32
FILETYPE 0x1L // VFT_APP
FILESUBTYPE 0x0L // VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "{{ lang.block_key }}"
BEGIN
VALUE "Comments", "https://github.com/BLumia/pineapple-pictures"
VALUE "CompanyName", "Gary Wang"
VALUE "FileDescription", "{{ lang.strings.file_description | rc_escape }}"
VALUE "FileVersion", "@PROJECT_VERSION@"
VALUE "InternalName", "ppic"
VALUE "LegalCopyright", "MIT/Expat License - Copyright (C) 2026 Gary Wang"
VALUE "OriginalFilename", "ppic.exe"
VALUE "ProductName", "{{ lang.strings.product_name | rc_escape }}"
VALUE "ProductVersion", "@PROJECT_VERSION@"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", {{ lang.langid }}, {{ lang.code_page }}
END
END
{% endfor -%}
+127
View File
@@ -0,0 +1,127 @@
version = 1
source_language = "en"
[strings.1000]
msgid = "Pineapple Pictures"
context = "Explorer"
comment = "Application friendly name shown by Explorer, e.g. in the 'Open with' menu."
[strings.1001]
msgid = "JPEG Image"
comment = "File type name for: jpg, jpeg, jfif"
[strings.1002]
msgid = "GIF Animation Image"
comment = "File type name for: gif"
[strings.1003]
msgid = "PNG Image"
comment = "File type name for: png"
[strings.1004]
msgid = "Scalable Vector Graphics"
comment = "File type name for: svg"
[strings.1005]
msgid = "WebP Image"
comment = "File type name for: webp"
[strings.1006]
msgid = "AV1 Image File"
comment = "File type name for: avif"
[strings.1007]
msgid = "Windows Icon Image"
comment = "File type name for: ico"
[strings.1008]
msgid = "Apple Icon Image"
comment = "File type name for: icns"
[strings.1009]
msgid = "Photoshop Document"
comment = "File type name for: psd, psb, pdd, psdt"
[strings.1010]
msgid = "Krita Document"
comment = "File type name for: kra"
[strings.1011]
msgid = "GIMP Document"
comment = "File type name for: xcf"
[strings.1012]
msgid = "TARGA Image"
comment = "File type name for: tga"
[strings.1013]
msgid = "Tagged Image File Format"
comment = "File type name for: tif, tiff"
[strings.1014]
msgid = "Bitmap"
comment = "File type name for: bmp"
[strings.1015]
msgid = "Wireless Bitmap"
comment = "File type name for: wbmp"
[strings.1016]
msgid = "DirectDraw Surface"
comment = "File type name for: dds"
[strings.1017]
msgid = "High Dynamic Range Image"
comment = "File type name for: hdr"
[strings.1018]
msgid = "Interchange File Format"
comment = "File type name for: iff"
[strings.1019]
msgid = "Softimage Picture"
comment = "File type name for: pic"
[strings.1020]
msgid = "PiCture eXchange PC Paintbrush Image"
comment = "File type name for: pcx"
[strings.1021]
msgid = "Quite OK Image"
comment = "File type name for: qoi"
[strings.1022]
msgid = "Sun Raster Image"
comment = "File type name for: ras, sun"
[strings.1023]
msgid = "OpenRaster Image"
comment = "File type name for: ora"
[strings.1024]
msgid = "Animated Cursor"
comment = "File type name for: ani"
[strings.1025]
msgid = "Portable Float Map"
comment = "File type name for: pfm, phm"
[strings.1026]
msgid = "Silicon Graphics Image"
comment = "File type name for: rgb, rgba, bw, sgi"
[strings.1027]
msgid = "Pixar Raster Image"
comment = "File type name for: pxr"
[strings.1028]
msgid = "Scitex Continuous Tone"
comment = "File type name for: sct"
[strings.file_description]
msgid = "Pineapple Pictures - Image Viewer"
comment = "File description of the executable."
[strings.product_name]
msgid = "Pineapple Pictures"
comment = "Display name of the product."
BIN
View File
Binary file not shown.