mirror of
https://github.com/Insality/druid
synced 2025-06-27 02:17:52 +02:00
1.8 KiB
1.8 KiB
druid.lang_text API
at /druid/extended/lang_text.lua
Functions
Fields
init
lang_text:init(node, [locale_id], [adjust_type])
-
Parameters:
node
(string|node): The node_id or gui.get_node(node_id)[locale_id]
(string|nil): Default locale id or text from node as default[adjust_type]
(string|nil): Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
-
Returns:
- `` (druid.lang_text):
on_language_change
lang_text:on_language_change()
set_to
lang_text:set_to(text)
Setup raw text to lang_text component
-
Parameters:
text
(string): Text for text node
-
Returns:
Current
(druid.lang_text): instance
set_text
lang_text:set_text(text)
Setup raw text to lang_text component
-
Parameters:
text
(string): Text for text node
-
Returns:
Current
(druid.lang_text): instance
translate
lang_text:translate(locale_id, ...)
Translate the text by locale_id
-
Parameters:
locale_id
(string): Locale id...
(...): vararg
-
Returns:
Current
(druid.lang_text): instance
format
lang_text:format(...)
Format string with new text params on localized text
-
Parameters:
...
(...): vararg
-
Returns:
Current
(druid.lang_text): instance
Fields
- text (druid.text)
- node (node)
- on_change (event)
- druid (druid.instance)