From 726326924d5de4cfa3b112af917500d67d85ee7a Mon Sep 17 00:00:00 2001 From: Zughy <63455151+Zughy@users.noreply.github.com> Date: Sun, 5 Nov 2023 19:00:32 +0100 Subject: [PATCH] Clarify `get_translated_string` string argument (#13948) Co-authored-by: sfan5 Co-authored-by: Muhammad Rifqi Priyo Susanto Co-authored-by: rubenwardy --- doc/lua_api.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/lua_api.md b/doc/lua_api.md index 0d49e13b3..875556408 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -4111,9 +4111,10 @@ On some specific cases, server translation could be useful. For example, filter a list on labels and send results to client. A method is supplied to achieve that: -`minetest.get_translated_string(lang_code, string)`: Translates `string` using -translations for `lang_code` language. It gives the same result as if the string -was translated by the client. +`minetest.get_translated_string(lang_code, string)`: resolves translations in +the given string just like the client would, using the translation files for +`lang_code`. For this to have any effect, the string needs to contain translation +markup, e.g. `minetest.get_translated_string("fr", S("Hello"))`. The `lang_code` to use for a given player can be retrieved from the table returned by `minetest.get_player_information(name)`.