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

@ -15,6 +15,8 @@
#include <string>
#include <utility>
#include <vector>
#include <fmt/format.h>
#include <zlib.h>
#include "Common/Assert.h"
@ -24,7 +26,6 @@
#include "Common/Hash.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "DiscIO/Blob.h"
#include "DiscIO/CompressedBlob.h"
#include "DiscIO/DiscScrubber.h"
@ -256,8 +257,8 @@ static ConversionResultCode Output(OutputParameters parameters, File::IOFile* ou
parameters.inpos == 0 ? 0 : static_cast<int>(100 * *position / parameters.inpos);
const std::string text =
StringFromFormat(Common::GetStringT("%i of %i blocks. Compression ratio %i%%").c_str(),
parameters.block_number, num_blocks, ratio);
fmt::format(Common::GetStringT("{0} of {1} blocks. Compression ratio {2}%"),
parameters.block_number, num_blocks, ratio);
const float completion = static_cast<float>(parameters.block_number) / num_blocks;