Template:multitrans/documentation

This template is used to reduce Lua memory usage and running time on pages with large translation tables such as water, black, star, etc. It works by replacing a lot of separate Lua module invocations, one per or  call, with a single module invocation that handles a whole batch of translations at once. It has one parameter, data, which should contain the entire text of one or more translation tables; it is recommended to surround a whole set of translation tables with a call to.

An example usage:

Inside of the template, add a  to the beginning of translation templates:

The and  templates are pass-throughs, so that e.g.  generates the literal text , with braces replaced by brace-like Unicode chars and the pipe symbol replaced by a pipe-symbol-like Unicode char. These special chars are parsed by the Lua code and call the same code that underlyingly implements and, but because this all happens inside a single module invocation instead of a lot of separate module invocations, it's much faster and more memory-efficient.

If you are still having memory issues, try using. This loads all the language data into memory at once rather than loading it as needed. From experience, this almost always increases rather than reduces memory usage, but in exceptional cases it might result in the opposite.

Verifying proper use of template
(Note: this section is only relevant for those who regularly concern themselves with template maintenance.)

As of January 2, 2023, multitrans will automatically complain if one fails to replace t and t+ by tt and tt+.

To check for the reverse problem, i.e. people using tt and tt+ outside of the context of multitrans, a simple Python script has been written.