feat(i18n): 添加多语言支持功能

- 新增国际化系统,支持中英文切换
- 添加语言选择对话框和语言切换按钮回调
- 扩展配置系统以支持语言设置存储
- 创建语言文件目录结构和占位文件
- 更新主窗口支持UI文本动态刷新
This commit is contained in:
2026-03-26 20:44:22 +08:00
parent 9a78b88c4a
commit 4fe7dc47e4
2343 changed files with 127697 additions and 9 deletions
+35
View File
@@ -244,4 +244,39 @@ int lua_config_reload(void)
int lua_config_is_loaded(void)
{
return G_loaded;
}
int lua_config_set_string(const char *section, const char *key, const char *value)
{
if (section == NULL || key == NULL || value == NULL)
{
return -1;
}
if (G_L == NULL)
{
return -1;
}
lua_getglobal(G_L, "config");
if (!lua_istable(G_L, -1))
{
lua_settop(G_L, 0);
return -1;
}
lua_getfield(G_L, -1, section);
if (!lua_istable(G_L, -1))
{
lua_pop(G_L, 1);
lua_createtable(G_L, 0, 4);
lua_setfield(G_L, -2, section);
lua_getfield(G_L, -1, section);
}
lua_pushstring(G_L, value);
lua_setfield(G_L, -2, key);
lua_settop(G_L, 0);
return 0;
}