Formatter

No summary available

Import
the javascript logo
import { Formatter } from "@schukai/monster/source/i18n/formatter.mjs";
Source
the git logo
Package
the npm logo
Since
1.26.0

Exported

Formatter

Derived from

TextFormatter

Options

The Options listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the TextFormatter.

Option
Type
Default
Description
object
marker
array
marker.open=["i18n{","${"]
array
marker.close=["${"]
object
parameter
string
parameter.delimiter="::"
string
parameter.assignment="="
object
callbacks
function
callbacks.i18n=()=>{}

Properties

The Properties listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Properties from these parent classes. If you cannot find a specific Properties in this list, we recommend consulting the documentation of the TextFormatter.

Methods

The methods listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the TextFormatter.

Constructor

constructor(object,translation,options)
Parameters
  • object {object}: object
  • translation {translations}: translation
  • options {object}: [options]
Throws
  • {TypeError} value is not an object
Default values for the markers are ${ and }

Static methods

[instanceSymbol]()3.27.0
Returns
  • {symbol}
This method is called by the instanceof operator.

Other methods

format(text)
Parameters
  • text {string}: text
Returns
  • {string}
Throws
  • {TypeError} value is not a string
  • {Error} too deep nesting
  • {Error} key not found
  • {Error} the closing marker is missing

Events

This component does not fire any public events. It may fire events that are inherited from its parent classes.

The current width of the area is too small to display the content correctly.