Skip to content

Commit 22c5c65

Browse files
committed
Added support for displaying the interface in multiple languages, configurable in the options window.
Currently supports English, Japanese, Chinese, Spanish, Russian, French, and German languages. Language files are translated using ChatGPT. Added support for configuring the interface font in the options window.
1 parent 8468212 commit 22c5c65

29 files changed

+4634
-695
lines changed

PS4CheaterNeo/HexEditor.Designer.cs

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PS4CheaterNeo/HexEditor.cs

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public partial class HexEditor : Form
3737

3838
private HexEditor(Main mainForm)
3939
{
40+
this.Font = mainForm.Font;
4041
this.mainForm = mainForm;
4142
changedPosDic = new Dictionary<long, long>();
4243

@@ -46,7 +47,10 @@ private HexEditor(Main mainForm)
4647
mutex = new Mutex(false, "HexEditor", out _, mSec);
4748

4849
InitializeComponent();
49-
ApplyUI();
50+
InfoBox0.Font = new System.Drawing.Font(mainForm.UIFont, 8.25F);
51+
AsmBox1.Font = new System.Drawing.Font(mainForm.UIFont, 8.25F);
52+
53+
ApplyUI(mainForm.langJson);
5054

5155
delimitedDash = Properties.Settings.Default.HexInfoDash.Value;
5256
if (!Properties.Settings.Default.CollapsibleContainer.Value)
@@ -125,8 +129,37 @@ private void InitPageData(Section section, int baseAddr)
125129
PageBox.SelectedIndex = PageBox.Items.Count > Page ? Page : PageBox.Items.Count - 1;
126130
}
127131

128-
public void ApplyUI()
132+
public void ApplyUI(LanguageJson langJson)
129133
{
134+
try
135+
{
136+
if (langJson != null)
137+
{
138+
PreviousBtn.Text = langJson.HexEditorForm.PreviousBtn;
139+
NextBtn.Text = langJson.HexEditorForm.NextBtn;
140+
AutoRefreshBox.Text = langJson.HexEditorForm.AutoRefreshBox;
141+
RefreshBtn.Text = langJson.HexEditorForm.RefreshBtn;
142+
CommitBtn.Text = langJson.HexEditorForm.CommitBtn;
143+
AddToCheatGridBtn.Text = langJson.HexEditorForm.AddToCheatGridBtn;
144+
HexBox.Text = langJson.HexEditorForm.HexBox;
145+
LittleEndianBox.Text = langJson.HexEditorForm.LittleEndianBox;
146+
ForwardBox.Text = langJson.HexEditorForm.ForwardBox;
147+
FindBtn.Text = langJson.HexEditorForm.FindBtn;
148+
SwapBytesBox.Text = langJson.HexEditorForm.SwapBytesBox;
149+
AssemblerBtn.Text = langJson.HexEditorForm.AssemblerBtn;
150+
GroupBoxAsm.Text = langJson.HexEditorForm.GroupBoxAsm;
151+
152+
HexViewMenuByteGroup.Text = langJson.HexEditorForm.HexViewMenuByteGroup;
153+
HexViewMenuGroupSize.Text = langJson.HexEditorForm.HexViewMenuGroupSize;
154+
HexViewMenuCopyAddress.Text = langJson.HexEditorForm.HexViewMenuCopyAddress;
155+
HexViewMenuJumpToAddress.Text = langJson.HexEditorForm.HexViewMenuJumpToAddress;
156+
HexViewMenuJumpToOffset.Text = langJson.HexEditorForm.HexViewMenuJumpToOffset;
157+
}
158+
}
159+
catch (Exception ex)
160+
{
161+
PS4CheaterNeo.InputBox.MsgBox("Apply UI language Exception", "", ex.Message, 100);
162+
}
130163
try
131164
{
132165
Opacity = Properties.Settings.Default.UIOpacity.Value;

0 commit comments

Comments
 (0)