Represents a function that can be used in Localization files by piping template values into it. The function must accept the piped-in template value, and can optionally accept any other static values of the types string, number, or boolean. These additional values allow pipe functions to be configurable.
Note: The typings specify any type for these additional parameters, but the localization parser only supports string, number, and boolean primitives in the localization file syntax, which translate directly to their JavaScript equivalents
In the case of regular templates and optional templates, the piped-in value is of whatever type the template argument value is. In the case of include templates the piped-in value is always a string, given that the value is an included resource which is a fully-built localization string
Realistically pipe functions can transform the piped in data in many ways and can accept piped-in data of any type, given anything can be passed to Localization resources as desired. However, you should always make sure to be aware of how each function is transforming your data with regards to what is being piped into the next.
Represents a Proxy object for a specific language where function calls
will call Localization.resource() for that
language and forward the given TemplateArguments
to the resource lookup.
TypeScript note: Can be given a type parameter object where the keys are Localization string keys mapped to type objects that map template keys to template value types. This will provide type hinting for both template key names (methods on the proxy) and the template arguments they expect. Example:
type Resources = { foo: { bar: string, baz?: number } };
const proxy: LocalizationResourceProxy<Resources> = Localization.getResourceProxy('en-US');
const foo: string = proxy.foo({ bar: 'baz' });
// The compiler knows that the value of `bar` should be a string, and
// that `baz` expects a number but is optional
Represents a language identifier (string) or tuple of string identifiers that lead to a distinct set of localization resources. The value will be interpreted as follows:
[language, category, subcategory] // Self-explanatory
[language, category] // Defaults to 'default' subcategory
[language] // Defaults to 'default' category, 'default' subcategory
'language' // Defaults to 'default' category, 'default' subcategory
CommandInfoProvider function that can provide localized command info for the given command in the given language if it exists
Generated using TypeDoc
Represents a function that can provide information about the given command in the given language. Accepts a prefix to pass to the localization resources that will be loaded