From 30aa528f8476b994ed54ffccf69f42031c4beb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90e=C3=A4Th?= <55578911+DeaTh-G@users.noreply.github.com> Date: Thu, 3 Apr 2025 19:49:40 +0200 Subject: [PATCH] Fix line splitting issues from localization changes (#1503) * fix wrongly split lines from localization changes * skip 0x200B line split guidance like new line if line starts with it --- UnleashedRecomp/locale/config_locale.cpp | 6 +++--- UnleashedRecomp/locale/locale.cpp | 2 +- UnleashedRecomp/ui/imgui_utils.cpp | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/UnleashedRecomp/locale/config_locale.cpp b/UnleashedRecomp/locale/config_locale.cpp index 7da6dc86..1242e4eb 100644 --- a/UnleashedRecomp/locale/config_locale.cpp +++ b/UnleashedRecomp/locale/config_locale.cpp @@ -233,7 +233,7 @@ CONFIG_DEFINE_ENUM_LOCALE(EControllerIcons) { ELanguage::English, { - { EControllerIcons::Auto, { "AUTO", "Auto : the game will determine which icons to use based on the current input device." } }, + { EControllerIcons::Auto, { "AUTO", "Auto: the game will determine which icons to use based on the current input device." } }, { EControllerIcons::Xbox, { "XBOX", "" } }, { EControllerIcons::PlayStation, { "PLAYSTATION", "" } } } @@ -407,7 +407,7 @@ CONFIG_DEFINE_LOCALE(EffectsVolume) CONFIG_DEFINE_LOCALE(MusicAttenuation) { { ELanguage::English, { "Music Attenuation", "Fade out the game's music when external media is playing." } }, - { ELanguage::Japanese, { "BGM[減衰:げんすい]", "[外部:がいぶ]メディアを\u200B[再生:さいせい]すると\u200Bゲームの\u200B[音楽:おんがく]を\u200Bフェードアウトします" } }, + { ELanguage::Japanese, { "BGM[減衰:げんすい]", "[外部:がいぶ]メディアを\u200B[再生:さいせい]すると\u200Bゲームの\u200B[音楽:おんがく]を\u200Bフェードアウト\u200Bします" } }, { ELanguage::German, { "Musikdämpfung", "Stelle die Musik des Spiels stumm während externe Medien abgespielt werden." } }, { ELanguage::French, { "Atténuation audio", "Abaisse le volume des musiques du jeu lorsqu'un média externe est en cours de lecture." } }, { ELanguage::Spanish, { "Atenuación de música", "Atenúa la música del juego cuando un reproductor multimedia se encuentra activo." } }, @@ -508,7 +508,7 @@ CONFIG_DEFINE_LOCALE(BattleTheme) CONFIG_DEFINE_LOCALE(WindowSize) { { ELanguage::English, { "Window Size", "Adjust the size of the game window in windowed mode." } }, - { ELanguage::Japanese, { "ウィンドウサイズ", "ウィンドウモードでの\u200Bゲームの\u200Bウィンドウサイズを\u200B[調整:ちょうせい]できます" } }, + { ELanguage::Japanese, { "ウィンドウサイズ", "ウィンドウ\u200Bモードでの\u200Bゲームの\u200Bウィンドウサイズを\u200B[調整:ちょうせい]できます" } }, { ELanguage::German, { "Fenstergröße", "Ändere die Größe des Spielfensters im Fenstermodus." } }, { ELanguage::French, { "Taille de la fenêtre", "Modifie la taille de la fenêtre de jeu en mode fenêtré." } }, { ELanguage::Spanish, { "Tamaño de ventana", "Ajusta el tamaño de la ventana de juego." } }, diff --git a/UnleashedRecomp/locale/locale.cpp b/UnleashedRecomp/locale/locale.cpp index 27bf6f22..7544f31c 100644 --- a/UnleashedRecomp/locale/locale.cpp +++ b/UnleashedRecomp/locale/locale.cpp @@ -366,7 +366,7 @@ std::unordered_map> { ELanguage::English, "Installation complete!\nThis project is brought to you by:" }, { ELanguage::Japanese, "インストール[完了:かんりょう]!\nプロジェクト[制作:せいさく]:" }, { ELanguage::German, "Installation abgeschlossen!\nDieses Projekt wird präsentiert von:" }, - { ELanguage::French, "Installation terminée !\nCe projet vous est présenté par :" }, + { ELanguage::French, "Installation terminée !\nCe projet vous est présenté\npar :" }, { ELanguage::Spanish, "¡Instalación completada!\nEste proyecto ha sido posible gracias a:" }, { ELanguage::Italian, "Installazione completata!\nQuesto progetto è stato creato da:" } } diff --git a/UnleashedRecomp/ui/imgui_utils.cpp b/UnleashedRecomp/ui/imgui_utils.cpp index be085b4c..31592bf9 100644 --- a/UnleashedRecomp/ui/imgui_utils.cpp +++ b/UnleashedRecomp/ui/imgui_utils.cpp @@ -510,6 +510,11 @@ std::vector Split(const char* strStart, const ImFont* font, float f if (*str == '\n') str++; + if (strncmp(str, "\u200B", 3) == 0) + { + str += 3; + } + lineStart = str; continue; }