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
This commit is contained in:
Dav999-v authored and Misa Elizabeth Kai committed 2022-12-31 20:04:56 -08:00
1 parent c142b3bb3b
commit 1e45e263f5
1 file changed
+6 -9
+6 -9
View File
@@ -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;