# Module `LangText`

Component to wrap over GUI Text nodes with localization helpers

# Overview #

• The initialization of druid.set_text_function is required to enable localization using the localization ID.

• The LangText component supports up to 7 string format parameters. This limitation exists due to certain issues with using ... arguments.

# Notes #

Example Link

## Functions

format(self, a, b, c, d, e, f, g) | Format string with new text params on localized text
init(self, node[, locale_id=node_text[, adjust_type=downscale]]) | The LangText constructor
set_to(self, text) | Setup raw text to lang_text component
translate(self, locale_id, a, b, c, d, e, f, g) | Translate the text by locale_id

## Fields

node | Text node
on_change | On change text callback
text | The text component

## Functions

format(self, a, b, c, d, e, f, g)
  Format string with new text params on localized text

  ### Parameters:

  - self LangText LangText
  - a string or nil Optional param to string.format
  - b string or nil Optional param to string.format
  - c string or nil Optional param to string.format
  - d string or nil Optional param to string.format
  - e string or nil Optional param to string.format
  - f string or nil Optional param to string.format
  - g string or nil Optional param to string.format

  ### Returns:

  LangText Current instance
init(self, node[, locale_id=node_text[, adjust_type=downscale]])
  The LangText constructor

  ### Parameters:

  - self LangText LangText
  - node string or node The node_id or gui.get_node(node_id)
  - locale_id string Default locale id or text from node as default (default node_text)
  - adjust_type string Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference (default downscale)
set_to(self, text)
  Setup raw text to lang_text component

  ### Parameters:

  - self LangText LangText
  - text string Text for text node

  ### Returns:

  LangText Current instance
translate(self, locale_id, a, b, c, d, e, f, g)
  Translate the text by locale_id

  ### Parameters:

  - self LangText LangText
  - locale_id string Locale id
  - a string or nil Optional param to string.format
  - b string or nil Optional param to string.format
  - c string or nil Optional param to string.format
  - d string or nil Optional param to string.format
  - e string or nil Optional param to string.format
  - f string or nil Optional param to string.format
  - g string or nil Optional param to string.format

  ### Returns:

  LangText Current instance

## Fields

node
  Text node
  - node node
on_change
  On change text callback
  - on_change DruidEvent DruidEvent
text
  The text component
  - text Text Text

generated by LDoc TESTING Last updated 2015-01-01 12:00:00