Skip to content

Core - Translator Module

anvil.lib.translator

AnvilTranslator

__export__()

Export translations to Anvil's .lang file format.

__init__()

Collect localization entries during compilation, merge them with localization.csv, optionally fill missing translations, and export Minecraft .lang files.

add_entries(entries)

Add multiple localization entries.

add_localization_entry(key, value)

Add or update a localization entry in the source language.

auto_translate_all(languages=None)

Queue languages for translation during the next export sync.

format_key(key)

Format a localization key using only alphanumeric characters and dots, no starting with a digit, suitable for use in Minecraft .lang files.

get_localization_value(key)

Return the current source-language value for a localization key.