Skip to content

Development Diary - June 2026


2026-06-04: Constrain Language.ini fallback chain

Tightened the English stock fallback added in 2026-05-27 so it only activates when needed, and stops breaking non-English deployments.

Symptoms observed on CI: - Linux Flatpak build broke because <xlocale.h> does not exist on Linux glibc. Fix: guard the include behind __APPLE__ and define _GNU_SOURCE on other POSIX so uselocale/newlocale stay visible. - macOS replay test (brazilian deploy) regressed with [INI] ERROR: No files read from directory 'Data\English\Language' followed by a fatal INI_CANT_OPEN_FILE throw, because the fallback unconditionally loaded English even when: a) the deploy has no English at all (brazilian-only data), or b) the primary already provided a working UnicodeFontName (so falling back was both unnecessary and harmful: INI_LOAD_MULTIFILE would overwrite brazilian's font descriptor with English's).

Fix in Core/GameEngine/Source/GameClient/GlobalLanguage.cpp: - Trigger the English fallback only when m_unicodeFontName.isEmpty() after the primary load. This covers the russifier case (mod overrides UnicodeFontName to a macOS-Cyrillic-unfriendly font and leaves the field effectively broken) and leaves official localizations alone. - Before invoking the fallback, probe Data\English\Language.ini with TheFileSystem->doesFileExist and skip silently when the file is not present in the deploy. - CI for any official language (brazilian, polish, german, etc.) now works regardless of whether the deploy ships English.

Validation: - Russian (russifier): fallback still fires, fills Cyrillic font. - English: no-op. - Brazilian: primary wins, no overwrite, no fatal throw.


2026-06-03: Fix Cyrillic string formatting on macOS (Issue #144)

Closed the last open Cyrillic regression on macOS by fixing vswprintf in UnicodeString::format_va. Reporter confirmed Строительство: 57% now renders on the 3D construction caption.

Root cause: - macOS vswprintf returns -1 when the wide-char format string contains any non-ASCII code point under the default "C" locale. - This silently truncated every buffer.format(..., %.0f%%) call whose template included Cyrillic, producing an empty UnicodeString and a width=0 caption. - Same root cause was hiding tooltip text on some paths, even when the underlying font was correctly resolved to Arial Unicode MS.

Fix: - Core/GameEngine/Source/Common/System/UnicodeString.cpp - format_va now wraps vswprintf in uselocale(newlocale(LC_CTYPE_MASK, "UTF-8", 0)) for the duration of the call, then restores the previous thread locale. Single static locale_t, no per-call allocation.

Diagnostic instrumentation kept in tree (per reporter request, will revisit after more user testing): - Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp: Cyrillic glyph load + delegation logging. - GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp: constructor/format/draw logging for construct % caption. - GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp: font load + alternate-unicode decision logging.

Validation: - Russian test: Строительство: 57% renders in 3D. - English test: construction text unaffected. - Tooltip override on ControlBarPopupDescription still active.

Follow-up: - decide later whether to remove diagnostic logs or move them behind a debug flag. - check whether other language packs (PL, DE, FR) hit the same vswprintf failure mode.


2026-06-02: Cyrillic 3D caption investigation session

See docs/WORKDIR/reports/ISSUE144_SESSION_SUMMARY_2026-06-02.md for the full investigation timeline. Confirmed that fonts themselves were loading correctly and that the failure was downstream of font selection.