goog.i18n.MessageFormat |
pattern
: string
The pattern we parse and apply positional parameters
to.
|
Builds a placeholder from the last index of the array.
|
code » | ||||||
Breaks pattern into strings and top level {...} blocks.
|
code » | ||||||
Formats a message, treating '#' with special meaning representing
the number (plural_variable - offset).
Arguments:
Returns: string
Formatted message.
|
code » | ||||||
![]()
Parses generic block and returns a formatted string.
Arguments:
|
code » | ||||||
Formats a message, treating '#' as literary character.
Arguments:
Returns: string
Formatted message.
|
code » | ||||||
![]()
Formats plural or selectordinal block. Only one option is selected and all #
are replaced.
Arguments:
|
code » | ||||||
![]()
Formats select block. Only one option is selected.
Arguments:
|
code » | ||||||
![]()
Formats simple placeholder.
|
code » | ||||||
Formats a message.
Arguments:
Returns: string
Formatted message.
|
code » | ||||||
Replaces string literals with literal placeholders.
Literals are string of the form '}...', '{...' and '#...' where ... is
set of characters not containing '
Builds a dictionary so we can recover literals during format phase.
|
code » | ||||||
![]()
Detects which type of a block is the pattern.
Arguments:
Returns: goog.i18n.MessageFormat.BlockType_
One of the block types.
|
code » | ||||||
Parses generic block.
|
code » | ||||||
Parses an ordinal type of a block and produces JSON object for it.
For example the input string:
'{FOO, selectordinal, one {Message A}other {Message B}}'
Should result in the output object:
{
argumentIndex: 'FOO',
argumentOffest: 0,
one: [ { type: 4, value: 'Message A' } ],
other: [ { type: 4, value: 'Message B' } ]
}
|
code » | ||||||
![]()
Parses input pattern into an array, for faster reformatting with
different input parameters.
Parsing is locale independent.
Arguments:
|
code » | ||||||
Parses a plural type of a block and produces JSON object for it.
|
code » | ||||||
Parses a select type of a block and produces JSON object for it.
|
code » |
![]()
Literal strings, including '', are replaced with \uFDDF_x_ for
parsing purposes, and recovered during format phase.
\uFDDF is a Unicode nonprinting character, not expected to be found in the
typical message.
|
Code » | |
![]()
A regular expression to parse the ordinal block, extracting the argument
index.
|
Code » | |
![]()
Mandatory option in both select and plural form.
|
Code » | |
![]()
A regular expression to parse the plural block, extracting the argument
index and offset (if any).
|
Code » | |
![]()
Regular expression for looking for '' in the message.
|
Code » | |
![]()
Regular expression for looking for string literals.
|
Code » | |
![]()
A regular expression to parse the select block, extracting the argument
index.
|
Code » |
![]()
Block type.
Constants:
|
Code » | |||||||
![]()
Marks a string and block during parsing.
Constants:
|
Code » |