From c892c521ea642cd5c406f5a6eab7159ba9f871bd Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 9 Nov 2021 19:57:38 +0100 Subject: [PATCH] More preparation for localization. --- src/include/86box/win.h | 1 + src/win/win.c | 9 +++++++++ src/win/win_settings.c | 12 ++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 079463214..a986456d9 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -129,6 +129,7 @@ extern void do_start(void); extern void do_stop(void); /* Internal platform support functions. */ +extern int has_language_changed(int id); extern void set_language(int id); extern int get_vidpause(void); extern void show_cursor(int); diff --git a/src/win/win.c b/src/win/win.c index 591caecac..d7094ec50 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -241,6 +241,15 @@ size_t c16stombs(char dst[], const uint16_t src[], int len) } +int +has_language_changed(int id) +{ + LCID lcidNew = MAKELCID(id, dwSubLangID); + + return (lang_id != lcidNew); +} + + /* Set (or re-set) the language for the application. */ void set_language(int id) diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 668487d00..e8e4f831a 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -77,6 +77,9 @@ static int first_cat = 0; static int dpi = 96; +/* Language */ +static int temp_language; + /* Machine category */ static int temp_machine_type, temp_machine, temp_cpu, temp_wait_states, temp_fpu, temp_sync; static cpu_family_t *temp_cpu_f; @@ -322,6 +325,9 @@ win_settings_init(void) { int i = 0; + /* Language */ + // TODO: Set temp_language here. + /* Machine category */ temp_machine_type = machines[machine].type; temp_machine = machine; @@ -447,6 +453,9 @@ win_settings_changed(void) { int i = 0, j = 0; + /* Language */ + // i = i || has_language_changed(temp_language); + /* Machine category */ i = i || (machine != temp_machine); i = i || (cpu_f != temp_cpu_f); @@ -537,6 +546,9 @@ win_settings_save(void) pc_reset_hard_close(); + /* Language */ + // set_language(temp_language); + /* Machine category */ machine = temp_machine; cpu_f = temp_cpu_f;