mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +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
|
@ -54,6 +54,7 @@ const std::wstring &Translations::getTranslation(
|
|||
void Translations::loadTranslation(const std::string &data)
|
||||
{
|
||||
std::istringstream is(data);
|
||||
std::string textdomain_narrow;
|
||||
std::wstring textdomain;
|
||||
std::string line;
|
||||
|
||||
|
@ -70,7 +71,8 @@ void Translations::loadTranslation(const std::string &data)
|
|||
<< "\"" << std::endl;
|
||||
continue;
|
||||
}
|
||||
textdomain = utf8_to_wide(trim(parts[1]));
|
||||
textdomain_narrow = trim(parts[1]);
|
||||
textdomain = utf8_to_wide(textdomain_narrow);
|
||||
}
|
||||
if (line.empty() || line[0] == '#')
|
||||
continue;
|
||||
|
@ -116,7 +118,7 @@ void Translations::loadTranslation(const std::string &data)
|
|||
|
||||
if (i == wline.length()) {
|
||||
errorstream << "Malformed translation line \"" << line << "\""
|
||||
<< std::endl;
|
||||
<< " in text domain " << textdomain_narrow << std::endl;
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue