Skip to content

Commit

Permalink
Clarify get_translated_string string argument (#13948)
Browse files Browse the repository at this point in the history
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
  • Loading branch information
4 people committed Nov 5, 2023
1 parent 4d2227c commit 7263269
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/lua_api.md
Expand Up @@ -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)`.
Expand Down

0 comments on commit 7263269

Please sign in to comment.