forked from Mirrorlandia_minetest/minetest
Clarify get_translated_string
string argument (#13948)
Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com> Co-authored-by: rubenwardy <rw@rubenwardy.com>
This commit is contained in:
parent
4d2227cfa5
commit
726326924d
@ -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
|
a list on labels and send results to client. A method is supplied to achieve
|
||||||
that:
|
that:
|
||||||
|
|
||||||
`minetest.get_translated_string(lang_code, string)`: Translates `string` using
|
`minetest.get_translated_string(lang_code, string)`: resolves translations in
|
||||||
translations for `lang_code` language. It gives the same result as if the string
|
the given string just like the client would, using the translation files for
|
||||||
was translated by the client.
|
`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 `lang_code` to use for a given player can be retrieved from
|
||||||
the table returned by `minetest.get_player_information(name)`.
|
the table returned by `minetest.get_player_information(name)`.
|
||||||
|
Loading…
Reference in New Issue
Block a user