Skip to content

feat: Add multi-language support (i18n) via Resx config#596

Merged
Iridium-IO merged 29 commits intoIridiumIO:masterfrom
XTsat:master
Apr 15, 2026
Merged

feat: Add multi-language support (i18n) via Resx config#596
Iridium-IO merged 29 commits intoIridiumIO:masterfrom
XTsat:master

Conversation

@XTsat
Copy link
Copy Markdown
Contributor

@XTsat XTsat commented Dec 30, 2025

I rewrote the software translation based on the resx resource dictionary.

我基于resx资源字典重新做了一个软件翻译版本

Interface Display (界面展示)

image image

You can refresh the page language without restarting the switching page, but the title will not refresh

不重启切换页面可以刷新页面语言,但是标题不会刷新

image

The text that needs to be displayed in the designer interface is an additional addition to the original text

设计器界面需要显示的文字都额外增加了原始文本

image

Language Contributions (语言贡献)

I added the @i18n character where the code needs to add the language code

我在代码需要添加语言代码的地方增加了 @i18n 字符

image

Consider using Crowdin to join or download ResX Manager for quick editing

可以考虑使用 Crowdin 接入,或是下载 ResX Manager 进行快速编辑

image

ResX Manager can use machine translation to quickly generate multilingual translation files and have them edited by local people in each language, so I only submitted Chinese translations

可以使用 ResX Manager 中的机器翻译快速生成多语言翻译文件,再由各语言本地人员润色,所以我只提交了中文翻译

image

VS resx can also be used normally, but it cannot block some content that can be used without localization

VS的 resx 也可以正常使用,不过不能屏蔽部分可以不用本地化的内容

image

@XTsat
Copy link
Copy Markdown
Contributor Author

XTsat commented Dec 30, 2025

Additional Notes (额外说明)

Comparison of advantages and disadvantages compared to JSON (相比 json 的优缺点比较)

Pros: (优点)

  • No error will be reported because the language is not updated in time, and the language that is not updated will load
    en-US by default
  • You can easily view and add languages
  • 不会因为没有及时更新语言而报错,没有更新的语言默认加载 en-US
  • 可以便捷的查看和增添语言

Cons: (缺点)

  • It is troublesome to refresh the language in real time without installing the plugin, and you need to restart to fully load the new language
  • When writing code, you need to bind the key to use
  • 不安装插件做实时刷新语言比较麻烦,需要重启才能完全加载新语言
  • 在编写代码的时候需要绑定 Key 使用

Use ResX Manager for quick conversions (使用 ResX Manager 快速转换)

Add "{local:Localize $Key}" to the program's xaml configuration
Add local:Localize $Key to the program's vb configuration
Remember to add the division number |

在程序的 xaml 配置中添加 "{local:Localize $Key}"
在程序的 vb 配置中添加 local:Localize $Key
记得添加分割号 |

image

@XTsat
Copy link
Copy Markdown
Contributor Author

XTsat commented Jan 20, 2026

I've merged the portable data section from my new issue #601 into the main branch. If you only need to merge the i18n related pr, l need to recreate the pr on tag v4.0.0-beta.7.
This commit also includes a new README
CompactGUI_i18n

我将我的新需求 #601 中的便携数据部分合并进主分支了,如果需要仅合并 i18n 相关的pr,需要重新创建基于 tag v4.0.0-beta.7 的提交
这次提交还包含了新的 README
CompactGUI_i18n

PixPin_2026-01-21_03-27-24
PixPin_2026-01-21_03-27-45

@Blueberryy
Copy link
Copy Markdown
Contributor

when this gets merged?

@Blueberryy
Copy link
Copy Markdown
Contributor

@XTsat please merge Russian translation PR that i made for your fork XTsat#3

@Blueberryy
Copy link
Copy Markdown
Contributor

and please note that i didnt made screenshots so they might need to be made by you because i don't know what resolution you had to make those

@XTsat
Copy link
Copy Markdown
Contributor Author

XTsat commented Mar 29, 2026

@XTsat please merge Russian translation PR that i made for your fork XTsat#3

I haven't received any pull request notifications from GitHub.
I will check the merger tomorrow.

@Iridium-IO
Copy link
Copy Markdown
Member

I missed the fact that you permanently changed the data folders to use local storage instead, this actually breaks existing installations and existing watched folders - I was trying to figure out why the localisation PR wasn't working on my computer.

I'm going to remove those because there's a better way of implementing that as an option, but I'm in the process of reviewing and then will merge the language features :)

@XTsat
Copy link
Copy Markdown
Contributor Author

XTsat commented Apr 15, 2026

I've merged the portable data section from my new issue #601 into the main branch. If you only need to merge the related pr, l need to recreate the pr on 。 This commit also includes a new README CompactGUI_i18ni18n``tag v4.0.0-beta.7

我将我的新需求 #601 中的便携数据部分合并进主分支了,如果需要仅合并 相关的pr,需要重新创建基于 的提交
这次提交还包含了新的 README
CompactGUI_i18ni18n``tag v4.0.0-beta.7

I mentioned I changed the data path to local, based on the following considerations:

  1. Clicking the database while it is still loading will cause a crash and may render the program unable to open. This allows quick checking of whether the database is faulty Sometimes the database crashes because it can't be loaded, not just when you click on the database #601.
  2. Some issues reported that the software could not be opened. Now users can reset the program simply by deleting the data folder, making it much more convenient compared to opening %IridiumIO%/CompactGUI (a button to open the program directory could be added).PixPin_2026-04-15_10-56-30
  3. We can directly send others an offline archive containing non-latest database files to support offline usage.

If this approach is unnecessary and a better one exists, I think adding an open button in the program would be more convenient.

我有提到我将data改到了本地,我基于以下几点考量

  1. 加载数据库未完成的情况下点击数据库会导致闪退,而且可能无法打开程序,这样可以快速查看数据库是否有问题 Sometimes the database crashes because it can't be loaded, not just when you click on the database #601
  2. 有些 issue 有提到打不开软件,现在只需要删除 data 文件夹即可重置程序,这样可以更方便的重置程序,相比打开%IridiumIO%/CompactGUI(或许可以添加一个打开程序目录的按钮)PixPin_2026-04-15_11-05-23
  3. 可以直接发给别人离线压缩包,包含非最新的数据库文件,用于支持脱机使用

如果不需要这种方式,而是有更好的方式,我认为在程序中添加一个打开按钮比较方便

@XTsat
Copy link
Copy Markdown
Contributor Author

XTsat commented Apr 15, 2026

PixPin_2026-04-15_11-16-00

By the way, maybe an i18n button can be added here for language selection. I just reused the location where the previous JSON was used.
However, automatic detection would be better. I haven't tested other language regions, but the software didn't detect automatically successfully after resetting just now.

顺带一提,也许语言可以在这里添加一个i18n的按钮,我只是复用了之前 json 使用的位置
不过如果能支持自动识别的话更好,我没有测试其它语言区域,但是刚才重置软件似乎没有自动识别成功

PixPin_2026-04-15_11-24-15.mp4

@Iridium-IO Iridium-IO merged commit 44aa15c into IridiumIO:master Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants