From a9f82ef9750690f39ed1fe87daa275abccd32841 Mon Sep 17 00:00:00 2001 From: BSzili Date: Tue, 23 Sep 2025 17:59:06 +0200 Subject: [PATCH] French localization support --- src/harness/harness.c | 11 +++++++++++ src/harness/include/harness/config.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/harness/harness.c b/src/harness/harness.c index 3ea92512..4e150a43 100644 --- a/src/harness/harness.c +++ b/src/harness/harness.c @@ -186,6 +186,9 @@ static void Harness_DetectGameMode(void) { } else if (strstr(buffer, "NOWA GRA") != NULL) { harness_game_info.localization = eGameLocalization_polish; LOG_INFO2("Language: \"%s\"", "Polish"); + } else if (strstr(buffer, "NOUVELLE PARTIE") != NULL) { + harness_game_info.localization = eGameLocalization_french; + LOG_INFO2("Language: \"%s\"", "French"); } else { LOG_INFO("Language: unrecognized"); } @@ -547,6 +550,14 @@ int Harness_Hook_isalnum(int c) { return 1; } } + } if (harness_game_info.localization == eGameLocalization_french) { + // French diacritic letters in Windows-1252 + unsigned char letters[] = { 140, 156, 159, 192, 194, 198, 199, 200, 201, 202, 203, 206, 207, 212, 217, 219, 220, 224, 226, 230, 231, 232, 233, 234, 235, 238, 239, 244, 249, 251, 252, 255 }; + for (i = 0; i < (int)sizeof(letters); i++) { + if ((unsigned char)c == letters[i]) { + return 1; + } + } } return isalnum(c); diff --git a/src/harness/include/harness/config.h b/src/harness/include/harness/config.h index 98b7e144..71ee8e3a 100644 --- a/src/harness/include/harness/config.h +++ b/src/harness/include/harness/config.h @@ -16,6 +16,7 @@ typedef enum { eGameLocalization_none, eGameLocalization_german, eGameLocalization_polish, + eGameLocalization_french, } tHarness_game_localization; typedef struct tHarness_game_info {