Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
509dff5
feat: Add non-invasive Chinese localization system for UOFiddler 4.24.0
nbyaya Oct 3, 2026
e2136ee
fix: Correct tab names in zh-CN.json to match actual control names
nbyaya Oct 3, 2026
78552f6
fix: Add support for ToolStrip menu localization
nbyaya Oct 3, 2026
1075e40
feat: Add LoadProfileForm localization support
nbyaya Oct 3, 2026
d95802d
fix: Support both .Text suffix and direct control name keys in Locali…
nbyaya Oct 3, 2026
f1d6f1a
feat: Add OptionsForm complete localization with all controls and labels
nbyaya Oct 3, 2026
5c94700
feat: Add PathSettingsForm localization
nbyaya Oct 3, 2026
2833dcd
fix: Add ToolStripButton localization support
nbyaya Oct 3, 2026
4e042f2
feat: Add ManageToolsForm localization and update ExternTools menu
nbyaya Oct 3, 2026
bfb89fd
fix: Localize dynamic ExternTools menu items (Manage.., Start) in Mai…
nbyaya Oct 3, 2026
552d95e
feat: Localize ManagePluginsForm, AboutBoxForm, and ExceptionForm
nbyaya Oct 3, 2026
3d81550
feat: Localize ManagePluginsForm plugin names with display-data separ…
nbyaya Oct 3, 2026
2a09683
fix: 修复插件多标签页汉化问题 - 支持 Compare 插件的 10 个标签页
nbyaya Oct 3, 2026
17e2153
feat: 汉化批量导入插件窗口
nbyaya Oct 3, 2026
eb70af4
feat: Localize MultiEditor and OptionsForm UI and tooltips
nbyaya Oct 3, 2026
a31fb77
feat: Localize AboutBoxForm changelog
nbyaya Oct 3, 2026
cc38bec
汉化 SendItem 插件
nbyaya Oct 4, 2026
96837e2
汉化 PluginTest 插件
nbyaya Oct 4, 2026
5855316
更新汉化字典
nbyaya Oct 4, 2026
ffe4161
汉化:Compare插件词条补充
nbyaya Oct 4, 2026
1d2c4ef
完善:CompareTileDataControl汉化实现
nbyaya Oct 4, 2026
0a2cc42
完善:Compare所有控制汉化模式
nbyaya Oct 4, 2026
ba1e5c5
汉化 GumpControl 菜单项和完善 Ctrl 多选导出功能
nbyaya Oct 4, 2026
a071e75
实施 Shift+Click 范围选择和导出功能
nbyaya Oct 4, 2026
ef2b4de
汉化 GumpControl 提示信息和对话框文本
nbyaya Oct 4, 2026
3f49895
feat: 汉化 HuesControl 和 HueEditForm,修复 Load 事件重复调用陷阱
nbyaya Oct 4, 2026
0d653d7
汉化 MultisControl 标签项多重组件窗口内容
nbyaya Oct 4, 2026
422ee50
汉化 MultisControl 状态栏和帮助窗口 - JSON 词条
nbyaya Oct 4, 2026
7c751e0
汉化 MultisControl - 状态文本和帮助窗口
nbyaya Oct 4, 2026
1f6f9c5
汉化 MultisHelpForm - 帮助窗口
nbyaya Oct 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions UoFiddler.Controls/Forms/HueEditForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public partial class HueEditForm : Form
private int _selected;
private int _secondSel;
private Bitmap _preview;
private Func<string, string?>? _localizationGetter;

private int Selected
{
Expand Down Expand Up @@ -70,6 +71,45 @@ public HueEditForm(int index)
pictureBoxPreview.Image = new Bitmap(pictureBoxPreview.Width, pictureBoxPreview.Height);
}

/// <summary>
/// 设置本地化函数
/// </summary>
public void SetLocalization(Func<string, string?> getLocalized)
{
_localizationGetter = getLocalized;
ApplyLocalization();
}

private void ApplyLocalization()
{
if (_localizationGetter == null) return;

// 窗口标题 - 动态生成,保持索引信息
var titleFormat = _localizationGetter("Forms.HueEditForm.Title") ?? "HueEdit";
int hueIndex = int.Parse(Text.Split('/')[0].Replace("HueEdit ", "").Trim());
Text = $"{titleFormat} {hueIndex} / 0x{hueIndex:X}";

// 按钮
ColorPickerButton.Text = _localizationGetter("Forms.HueEditForm.ColorPickerButton") ?? "Color Picker";
SaveButton.Text = _localizationGetter("Forms.HueEditForm.SaveButton") ?? "Save";
Spread.Text = _localizationGetter("Forms.HueEditForm.Spread") ?? "Linear Gradient";
ExpGradientButton.Text = _localizationGetter("Forms.HueEditForm.ExpGradientButton") ?? "Exp Gradient";
InverseButton.Text = _localizationGetter("Forms.HueEditForm.InverseButton") ?? "Inverse";
ModifyRangeButton.Text = _localizationGetter("Forms.HueEditForm.ModifyRangeButton") ?? "Modify Range";
SetColorButton.Text = _localizationGetter("Forms.HueEditForm.SetColorButton") ?? "Set color";

// 标签
RLabel.Text = _localizationGetter("Forms.HueEditForm.RLabel") ?? "R:";
GLabel.Text = _localizationGetter("Forms.HueEditForm.GLabel") ?? "G:";
BLabel.Text = _localizationGetter("Forms.HueEditForm.BLabel") ?? "B:";

// 菜单项
itemToolStripMenuItem.Text = _localizationGetter("Forms.HueEditForm.itemToolStripMenuItem") ?? "Item";
animationToolStripMenuItem.Text = _localizationGetter("Forms.HueEditForm.animationToolStripMenuItem") ?? "Animation";
gumpToolStripMenuItem.Text = _localizationGetter("Forms.HueEditForm.gumpToolStripMenuItem") ?? "Gump";
hueOnlyGreyToolStripMenuItem.Text = _localizationGetter("Forms.HueEditForm.hueOnlyGreyToolStripMenuItem") ?? "Hue only Grey";
}

private int GetIndex(int x)
{
return (int)(x * 1.0 / (pictureBox.Width * 1.0 / _colors.Length * 1.0));
Expand Down
8 changes: 4 additions & 4 deletions UoFiddler.Controls/Forms/MultisHelpForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 61 additions & 13 deletions UoFiddler.Controls/Forms/MultisHelpForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
***************************************************************************/

using System;
using System.Drawing;
using System.Windows.Forms;
using UoFiddler.Controls.Classes;
Expand All @@ -17,27 +18,74 @@ namespace UoFiddler.Controls.Forms
{
public partial class MultisHelpForm : Form
{
private Func<string, string?>? _localizationGetter;

public MultisHelpForm()
{
InitializeComponent();
}

public void SetLocalization(Func<string, string?> getLocalized)
{
_localizationGetter = getLocalized;
ApplyLocalization();
}

private void ApplyLocalization()
{
if (_localizationGetter == null)
{
// 如果没有汉化,使用默认英文
PopulateShortcuts();
return;
}

// 应用窗口标题
Text = _localizationGetter("Forms.MultisControl.HelpForm.Title") ?? "Multis — Keyboard Shortcuts & Controls";

// 应用列标题
_columnKey.Text = _localizationGetter("Forms.MultisControl.HelpForm.ColumnShortcut") ?? "Shortcut / Control";
_columnAction.Text = _localizationGetter("Forms.MultisControl.HelpForm.ColumnAction") ?? "Action";

// 应用按钮文本
_btnClose.Text = _localizationGetter("Forms.MultisControl.HelpForm.ButtonClose") ?? "Close";

// 清除并重新填充列表
_listView.Items.Clear();
PopulateShortcuts();
}

private void PopulateShortcuts()
{
AddHeader("Preview");
Add("Fit preview to window", "Toggle button on toolbar — scales to fit or shows at 100% with scrollbars");

AddHeader("Zoom (100% mode only)");
Add("Ctrl + Mouse Wheel", "Zoom In / Out");
Add("Shift + = (Plus key)", "Zoom In");
Add("- (Minus key)", "Zoom Out");
Add("Numpad +", "Zoom In");
Add("Numpad -", "Zoom Out");
Add("Ctrl + 0", "Reset zoom to 100%");

AddHeader("Panning (100% mode only)");
Add("Left-click drag", "Pan the view");
// Preview 部分
AddHeader(GetLocalizedString("Forms.MultisControl.HelpForm.HeaderPreview", "Preview"));
Add(GetLocalizedString("Forms.MultisControl.HelpForm.PreviewFit", "Fit preview to window"),
GetLocalizedString("Forms.MultisControl.HelpForm.PreviewFitDesc", "Toggle button on toolbar — scales to fit or shows at 100% with scrollbars"));

// Zoom 部分
AddHeader(GetLocalizedString("Forms.MultisControl.HelpForm.HeaderZoom", "Zoom (100% mode only)"));
Add(GetLocalizedString("Forms.MultisControl.HelpForm.ZoomCtrlWheel", "Ctrl + Mouse Wheel"),
GetLocalizedString("Forms.MultisControl.HelpForm.ZoomCtrlWheelDesc", "Zoom In / Out"));
Add(GetLocalizedString("Forms.MultisControl.HelpForm.ZoomShiftPlus", "Shift + = (Plus key)"),
GetLocalizedString("Forms.MultisControl.HelpForm.ZoomShiftPlusDesc", "Zoom In"));
Add(GetLocalizedString("Forms.MultisControl.HelpForm.ZoomMinus", "- (Minus key)"),
GetLocalizedString("Forms.MultisControl.HelpForm.ZoomMinusDesc", "Zoom Out"));
Add(GetLocalizedString("Forms.MultisControl.HelpForm.ZoomNumpadPlus", "Numpad +"),
GetLocalizedString("Forms.MultisControl.HelpForm.ZoomNumpadPlusDesc", "Zoom In"));
Add(GetLocalizedString("Forms.MultisControl.HelpForm.ZoomNumpadMinus", "Numpad -"),
GetLocalizedString("Forms.MultisControl.HelpForm.ZoomNumpadMinusDesc", "Zoom Out"));
Add(GetLocalizedString("Forms.MultisControl.HelpForm.ZoomCtrl0", "Ctrl + 0"),
GetLocalizedString("Forms.MultisControl.HelpForm.ZoomCtrl0Desc", "Reset zoom to 100%"));

// Panning 部分
AddHeader(GetLocalizedString("Forms.MultisControl.HelpForm.HeaderPanning", "Panning (100% mode only)"));
Add(GetLocalizedString("Forms.MultisControl.HelpForm.PanningLeftDrag", "Left-click drag"),
GetLocalizedString("Forms.MultisControl.HelpForm.PanningLeftDragDesc", "Pan the view"));
}

private string GetLocalizedString(string key, string fallback)
{
return _localizationGetter?.Invoke(key) ?? fallback;
}

private void AddHeader(string text)
Expand Down
6 changes: 6 additions & 0 deletions UoFiddler.Controls/Plugin/PluginBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
***************************************************************************/

using System;
using System.Windows.Forms;
using Microsoft.Extensions.Logging;
using UoFiddler.Controls.Classes;
Expand All @@ -26,6 +27,11 @@ public abstract class PluginBase
public abstract string Author { get; }
public abstract string Version { get; }

/// <summary>
/// 静态属性:汉化字符串获取器,由主程序在启动时设置
/// </summary>
public static Func<string, string> LocalizationGetter { get; set; }

/// <summary>
/// Per-plugin logger, categorized by the concrete plugin type. Resolved on demand
/// since plugins are instantiated via Activator and cannot take constructor parameters.
Expand Down
2 changes: 1 addition & 1 deletion UoFiddler.Controls/UserControls/GumpControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading