1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Gettext and plural support for client-side translations (#14726)

---------

Co-authored-by: Ekdohibs <nathanael.courant@laposte.net>
Co-authored-by: y5nw <y5nw@protonmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
This commit is contained in:
y5nw 2024-10-13 11:29:08 +02:00 committed by GitHub
parent dbbe0ca065
commit e3aa79cffb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 1360 additions and 74 deletions

View file

@ -841,16 +841,12 @@ bool Client::loadMedia(const std::string &data, const std::string &filename,
return true;
}
const char *translate_ext[] = {
".tr", NULL
};
name = removeStringEnd(filename, translate_ext);
if (!name.empty()) {
if (Translations::isTranslationFile(filename)) {
if (from_media_push)
return false;
TRACESTREAM(<< "Client: Loading translation: "
<< "\"" << filename << "\"" << std::endl);
g_client_translations->loadTranslation(data);
g_client_translations->loadTranslation(filename, data);
return true;
}