DiscIO: Make use of fmt where applicable

Once nice benefit of fmt is that we can use positional arguments
in localizable strings. This a feature which has been
requested for the Korean translation of strings like
"Errors were found in %zu blocks in the %s partition."
and which will no doubt be useful for other languages too.
This commit is contained in:
JosJuice
2020-10-14 18:34:45 +02:00
parent c9b2fbb64b
commit d100c1dc37
6 changed files with 44 additions and 46 deletions

View File

@ -9,10 +9,11 @@
#include <locale>
#include <optional>
#include <fmt/format.h>
#include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h"
#include "Common/StringUtil.h"
#include "DiscIO/Enums.h"
#include "DiscIO/Filesystem.h"
#include "DiscIO/Volume.h"
@ -45,7 +46,7 @@ std::string NameForPartitionType(u32 partition_type, bool include_prefix)
return include_prefix ? "P-" + type_as_game_id : type_as_game_id;
}
return StringFromFormat(include_prefix ? "P%u" : "%u", partition_type);
return fmt::format(include_prefix ? "P{}" : "{}", partition_type);
}
}