core_namespace: 5.18 update
This commit is contained in:
@@ -239,57 +239,6 @@ function core.get_hit_params(groups, tool_capabilities , time_from_last_punch) e
|
||||
|
||||
|
||||
|
||||
-- Translations
|
||||
|
||||
--- is a simple wrapper around
|
||||
--- `core.translate`, and `core.get_translator(textdomain)(str, ...)` is
|
||||
--- equivalent to `core.translate(textdomain, str, ...)`.
|
||||
--- It is intended to be used in the following way, so that it avoids verbose
|
||||
--- repetitions of `core.translate`:
|
||||
---
|
||||
--- local S = core.get_translator(textdomain)
|
||||
--- S(str, ...)
|
||||
---
|
||||
--- As an extra commodity, if `textdomain` is nil, it is assumed to be "" instead.
|
||||
---
|
||||
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3329-L3338)
|
||||
---
|
||||
--- @param text_domain string
|
||||
--- @return fun(str: string, ...):string
|
||||
function core.get_translator(text_domain) end
|
||||
--- translates the string `str` with
|
||||
--- the given `textdomain` for disambiguation. The textdomain must match the
|
||||
--- textdomain specified in the translation file in order to get the string
|
||||
--- translated. This can be used so that a string is translated differently in
|
||||
--- different contexts.
|
||||
--- It is advised to use the name of the mod as textdomain whenever possible, to
|
||||
--- avoid clashes with other mods.
|
||||
--- This function must be given a number of arguments equal to the number of
|
||||
--- arguments the translated string expects.
|
||||
--- Arguments are literal strings -- they will not be translated, so if you want
|
||||
--- them to be, they need to come as outputs of `core.translate` as well.
|
||||
---
|
||||
--- For instance, suppose we want to translate "@1 Wool" with "@1" being replaced
|
||||
--- by the translation of "Red". We can do the following:
|
||||
---
|
||||
--- local S = core.get_translator()
|
||||
--- S("@1 Wool", S("Red"))
|
||||
---
|
||||
--- This will be displayed as "Red Wool" on old clients and on clients that do
|
||||
--- not have localization enabled. However, if we have for instance a translation
|
||||
--- file named `wool.fr.tr` containing the following:
|
||||
---
|
||||
--- \@1 Wool=Laine @1
|
||||
--- Red=Rouge
|
||||
---
|
||||
--- this will be displayed as "Laine Rouge" on clients with a French locale.
|
||||
---
|
||||
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3340-L3365)
|
||||
---
|
||||
--- @param textdomain string
|
||||
--- @param str string
|
||||
--- @return string
|
||||
function core.translate(textdomain, str, ...) end
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user