From 1e45e263f595cec12de2edd5efd795b726f821d4 Mon Sep 17 00:00:00 2001 From: Dav999-v Date: Fri, 30 Dec 2022 23:28:58 +0100 Subject: [PATCH] FileSystemUtils.cpp: make translatable setLevelDirError was changed from snprintf-style to VFormat, but it's only used in that file so... This commit is part of rewritten history of the localization branch. The original (unsquashed) commit history can be found here: https://github.com/Dav999-v/VVVVVV/tree/localization-orig --- desktop_version/src/FileSystemUtils.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index 60ce9cd5..7d72fd48 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -454,20 +454,16 @@ const char* FILESYSTEM_getLevelDirError(void) return levelDirError; } -static int setLevelDirError(const char* text, ...) +static void setLevelDirError(const char* text, const char* args_index, ...) { - va_list list; - int retval; - levelDirHasError = true; - va_start(list, text); - retval = SDL_vsnprintf(levelDirError, sizeof(levelDirError), text, list); + va_list list; + va_start(list, args_index); + vformat_buf_valist(levelDirError, sizeof(levelDirError), text, args_index, list); va_end(list); vlog_error("%s", levelDirError); - - return retval; } static bool FILESYSTEM_mountAssetsFrom(const char *fname) @@ -478,7 +474,8 @@ static bool FILESYSTEM_mountAssetsFrom(const char *fname) if (real_dir == NULL) { setLevelDirError( - "Could not mount %s: real directory doesn't exist", + loc::gettext("Could not mount {path}: real directory doesn't exist"), + "path:str", fname ); return false;