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:
parent
dbbe0ca065
commit
e3aa79cffb
28 changed files with 1360 additions and 74 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue