mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add clientside translations.
This commit is contained in:
parent
b28af0ed07
commit
b24e6433df
21 changed files with 629 additions and 46 deletions
|
@ -317,7 +317,7 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
|
|||
(e->number >> 8) & 0xFF,
|
||||
(e->number >> 0) & 0xFF);
|
||||
core::rect<s32> size(0, 0, e->scale.X, text_height * e->scale.Y);
|
||||
std::wstring text = unescape_enriched(utf8_to_wide(e->text));
|
||||
std::wstring text = unescape_translate(utf8_to_wide(e->text));
|
||||
core::dimension2d<u32> textsize = font->getDimension(text.c_str());
|
||||
v2s32 offset((e->align.X - 1.0) * (textsize.Width / 2),
|
||||
(e->align.Y - 1.0) * (textsize.Height / 2));
|
||||
|
@ -354,11 +354,11 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
|
|||
(e->number >> 8) & 0xFF,
|
||||
(e->number >> 0) & 0xFF);
|
||||
core::rect<s32> size(0, 0, 200, 2 * text_height);
|
||||
std::wstring text = unescape_enriched(utf8_to_wide(e->name));
|
||||
std::wstring text = unescape_translate(utf8_to_wide(e->name));
|
||||
font->draw(text.c_str(), size + pos, color);
|
||||
std::ostringstream os;
|
||||
os << distance << e->text;
|
||||
text = unescape_enriched(utf8_to_wide(os.str()));
|
||||
text = unescape_translate(utf8_to_wide(os.str()));
|
||||
pos.Y += text_height;
|
||||
font->draw(text.c_str(), size + pos, color);
|
||||
break; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue