Skip to content

L

Create a LocalizedTextSpec for translatable text.

Shorthand constructor that creates a text localization spec with the translation key and optional format arguments.

Parameters:

Name Type Description Default
key str

The message ID or semantic key for translation lookup.

required
*fmtargs Any

Optional formatting arguments for string interpolation.

()

Returns:

Type Description
LocalizedTextSpec

A LocalizedTextSpec instance.

Examples:

>>> spec = L("greeting", "World")
>>> # Will translate "greeting" with "World" as format argument