Host: Backport translations cache

Note: You'll need a new command line for lupdate.

..\..\..\dep\msvc\qt\6.5.0\msvc2022_64\bin\lupdate.exe ../ ../../core/ ../../util/ -tr-function-alias QT_TRANSLATE_NOOP+=TRANSLATE,QT_TRANSLATE_NOOP+=TRANSLATE_SV,QT_TRANSLATE_NOOP+=TRANSLATE_STR,QT_TRANSLATE_NOOP+=TRANSLATE_FS,QT_TRANSLATE_N_NOOP3+=TRANSLATE_FMT,QT_TRANSLATE_NOOP+=TRANSLATE_NOOP -ts duckstation-qt_LANGUAGE.ts
This commit is contained in:
Stenzek
2023-08-20 00:08:03 +10:00
parent 1ec6aee5bf
commit e57ad0b6aa
28 changed files with 499 additions and 413 deletions

View File

@ -338,14 +338,16 @@ void Host::OnInputDeviceDisconnected(const std::string_view& identifier)
fmt::format("Input device {} disconnected.", identifier), 10.0f);
}
TinyString Host::TranslateString(const char* context, const char* str, const char* disambiguation, int n)
s32 Host::Internal::GetTranslatedStringImpl(const std::string_view& context, const std::string_view& msg, char* tbuf,
size_t tbuf_space)
{
return str;
}
if (msg.size() > tbuf_space)
return -1;
else if (msg.empty())
return 0;
std::string Host::TranslateStdString(const char* context, const char* str, const char* disambiguation, int n)
{
return str;
std::memcpy(tbuf, msg.data(), msg.size());
return static_cast<s32>(msg.size());
}
std::optional<std::vector<u8>> Host::ReadResourceFile(const char* filename)