mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Add support for translating content titles and descriptions (#12208)
This commit is contained in:
parent
57de599a29
commit
b4be483d3e
12 changed files with 252 additions and 47 deletions
|
@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "client/sound.h"
|
||||
#include "client/tile.h"
|
||||
#include "util/enriched_string.h"
|
||||
#include "translation.h"
|
||||
|
||||
/******************************************************************************/
|
||||
/* Structs and macros */
|
||||
|
@ -165,7 +166,22 @@ public:
|
|||
return m_scriptdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get translations for content
|
||||
*
|
||||
* Only loads a single textdomain from the path, as specified by `domain`,
|
||||
* for performance reasons.
|
||||
*
|
||||
* WARNING: Do not store the returned pointer for long as the contents may
|
||||
* change with the next call to `getContentTranslations`.
|
||||
* */
|
||||
Translations *getContentTranslations(const std::string &path,
|
||||
const std::string &domain, const std::string &lang_code);
|
||||
|
||||
private:
|
||||
std::string m_last_translations_key;
|
||||
/** Only the most recently used translation set is kept loaded */
|
||||
Translations m_last_translations;
|
||||
|
||||
/** find and run the main menu script */
|
||||
bool loadMainMenuScript();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue