"""Translation backend router -- delegates to the configured provider."""

from transduck.providers import get_provider
from transduck.providers.prompts import build_messages, build_plural_messages


def translate(source_text, source_lang, target_lang, project_context, string_context, config):
    """Translate a single string using the configured provider."""
    provider = get_provider(config)
    return provider.translate(source_text, source_lang, target_lang, project_context, string_context, config)


def translate_plural(one, other, source_lang, target_lang, project_context, string_context, config):
    """Translate plural forms using the configured provider."""
    provider = get_provider(config)
    return provider.translate_plural(one, other, source_lang, target_lang, project_context, string_context, config)
