LLM processor for the translator behaviour.
Summary
Functions
Callback implementation for GettextTranslator.Processor.Translator.translate/2.
Translates a single message using the configured LLM provider, with optional additional instructions to guide the translation.
Functions
@spec translate( GettextTranslator.Processor.Translator.provider(), GettextTranslator.Processor.Translator.opts() ) :: {:ok, String.t()} | {:error, any()}
Callback implementation for GettextTranslator.Processor.Translator.translate/2.
@spec translate_single( GettextTranslator.Processor.Translator.provider(), map(), String.t() | nil ) :: {:ok, map()} | {:error, any()}
Translates a single message using the configured LLM provider, with optional additional instructions to guide the translation.
Parameters
provider- The provider config map fromParser.parse_provider/0opts- Map with:language_code,:message,:type, and optionally:plural_messageadditional_instructions- Optional string with extra instructions for the LLM
Returns
{:ok, %{translation: String.t(), plural_translation: String.t() | nil}}{:error, reason}