Skip to content

Commit

Permalink
Update language strings, message box, remove restart feature on setti…
Browse files Browse the repository at this point in the history
…ngs form (for good?)
  • Loading branch information
CatmanFan committed Jan 11, 2025
1 parent f607274 commit fad229a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
9 changes: 2 additions & 7 deletions FriishProduce/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void RefreshForm()

// -----------------------------

Program.Lang.String(vc_sega_country);
vc_sega_country.Text = Program.Lang.String("region").TrimEnd(':', ':').Trim();
vc_sega_dev_mdpad_enable_6b.Text = string.Format(Program.Lang.String("dev_mdpad_enable_6b", "vc_sega"), Program.Lang.Console(Platform.SMD));
Program.Lang.String(vc_sega_console_disableresetbutton, "vc_sega");

Expand Down Expand Up @@ -444,15 +444,10 @@ private void OK_Click(object sender, EventArgs e)
bool isDirty = isShown
&& (dirtyOption1 != languages.SelectedIndex
|| dirtyOption2 != reset_all_dialogs.Checked);
bool restart = isDirty && MessageBox.Show(Program.Lang.Msg(0), MessageBox.Buttons.YesNo, MessageBox.Icons.Information) == MessageBox.Result.Yes;
if (isDirty) MessageBox.Show(Program.Lang.Msg(0), MessageBox.Buttons.Ok, MessageBox.Icons.Information);

isShown = false;
DialogResult = DialogResult.OK;

if (restart)
{
Application.Restart();
}
}

private void Cancel_Click(object sender, EventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion FriishProduce/Strings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
},

"messages": {
"000": "An application restart is needed in order for changes to take effect.\nRestart now?",
"000": "An application restart is needed in order for changes to fully take effect.",
"001": "{0} has unsaved changes.\nWhat would you like to do?",
"002": "The file you have selected is of an invalid format.",
"003": "Successfully completed.\nOpen the output folder?",
Expand Down
2 changes: 1 addition & 1 deletion FriishProduce/Strings/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
},

"messages": {
"000": "Algunos cambios necesitan que se reinicie el programa para que tengan efecto.\n¿Reiniciar ahora?",
"000": "Algunos cambios necesitan que se reinicie el programa para que tengan efecto.",
"001": "El proyecto \"{0}\" ha sido cambiado.\n¿Qué desea hacer?",
"002": "El archivo seleccionado no es válido.",
"003": "Exportado con éxito.\n¿Quieres abrir la carpeta de salida?",
Expand Down
6 changes: 3 additions & 3 deletions FriishProduce/Strings/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
},

"messages": {
"000": "Un redémarrage est nécessaire pour que tous les changements aux réglages prennent effet.\nRedémarrer maintenant?",
"000": "Un redémarrage est nécessaire pour que tous les changements aux réglages prennent effet.",
"001": "«{0}» comporte des modifications non enregistrées.\nQu'est-ce que vous voudrais faire ?",
"002": "Le fichier précisé est invalide.",
"003": "Terminé avec succès.\nOuvrir le dossier de sortie ?",
Expand Down Expand Up @@ -213,9 +213,9 @@
"image_resize1": "Conserver les proportions",

"channel_metadata": "Métadonnées de la chaîne",
"channel_name": "Nom de la chaîne",
"channel_name": "Nom de la chaîne :",
"title_id": "Title ID :",
"video_mode": "Mode vidéo",
"video_mode": "Mode vidéo :",
"banner": "Banner de la chaîne",
"banner_details": "Détails du banner",
"banner_sound": "Son du banner",
Expand Down
Binary file modified FriishProduce/Strings/ja.json
Binary file not shown.
2 changes: 1 addition & 1 deletion FriishProduce/Strings/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
},

"messages": {
"000": "변경 사항을 적용하려면 응용 프로그램을 다시 시작해야 합니다.\n지금 다시 시작할까요?",
"000": "변경 사항을 적용하려면 응용 프로그램을 다시 시작해야 합니다.",
"001": "{0}에 저장되지 않은 변경사항이 있습니다.\n무엇을 하겠습니까?",
"002": "선택한 파일의 형식이 잘못되었습니다.",
"003": "성공적으로 완료되었습니다.\n출력 폴더를 열까요?",
Expand Down
2 changes: 1 addition & 1 deletion FriishProduce/Subforms/ContentOptions/Options_VC_SEGA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Options_VC_SEGA() : base()
controller_cb.Text = Program.Lang.String("controller", "projectform");
b_controller.Text = Program.Lang.String("controller_mapping", "projectform");

region.Text = Program.Lang.String("region");
region.Text = Program.Lang.String("region").TrimEnd(':', ':').Trim();
save_sram.Text = Program.Lang.String("save_data_enable", "projectform");
console_disableresetbutton.Text = Program.Lang.String("console_disableresetbutton", "vc_sega");
dev_mdpad_enable_6b.Text = string.Format(Program.Lang.String("dev_mdpad_enable_6b", "vc_sega"), Program.Lang.Console(Platform.SMD));
Expand Down
7 changes: 4 additions & 3 deletions FriishProduce/_classes/Program/MessageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ public static Result Show(string mainText, string description, string[] buttons,

if (dontShow >= 0) { t.VerificationText = Program.Lang.String("do_not_show"); }

if (!string.IsNullOrEmpty(t.MainInstruction) && Program.Lang.GetScript(t.MainInstruction) == Language.ScriptType.CJK)
if (Program.Lang.GetScript(mainText) == Language.ScriptType.CJK)
{
using System.Drawing.Font f = new(System.Drawing.SystemFonts.MessageBoxFont.FontFamily, 6.5f, System.Drawing.FontStyle.Regular);
t.Width = Math.Max(t.Width, System.Windows.Forms.TextRenderer.MeasureText(t.MainInstruction, f).Width + 15);
bool hasTitle = !string.IsNullOrEmpty(t.MainInstruction);
using System.Drawing.Font f = new(System.Drawing.FontFamily.GenericSansSerif, hasTitle ? 6.5f : 5.5f, System.Drawing.FontStyle.Regular);
t.Width = Math.Max(t.Width, System.Windows.Forms.TextRenderer.MeasureText(hasTitle ? t.MainInstruction : mainText, f).Width + (hasTitle ? 0 : 5));
}

var clicked = t.ShowDialog();
Expand Down

0 comments on commit fad229a

Please sign in to comment.