Core - Translator Module
anvil.lib.translator
AnvilTranslator
__init__()
Initialize the translator with an Excel file path.
add_entries(entries)
Add multiple localization entries to the en_US sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entries
|
Dict[str, str]
|
A dictionary of localization entries |
required |
add_localization_entry(key, value)
Add a new localization entry to the runtime memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The localization key |
required |
value
|
str
|
The English value |
required |
auto_translate_all(languages=None)
Automatically translate all entries from source language to target languages.
get_localization_value(key)
Get the localization value for a specific key from the source language (en_US).