or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/googletrans@4.0.x
tile.json

tessl/pypi-googletrans

tessl install tessl/pypi-googletrans@4.0.0

An unofficial Google Translate API for Python providing free text translation and language detection capabilities

Agent Success

Agent success rate when using this tile

100%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.01x

Baseline

Agent success rate without this tile

99%

task.mdevals/scenario-10/

Multi-Language Welcome Message System

Build a simple welcome message system that can display greetings in different languages based on user preference.

Requirements

Create a program that translates a welcome message into various languages. The system should:

  1. Accept a welcome message in English
  2. Translate it to a target language specified by the user
  3. Return the translated message

Your implementation should handle:

  • Translating text to at least 3 different target languages (Spanish, French, and Korean)
  • Proper resource management for translation operations
  • Extracting both the translated text and detected source language from translation results

Test Cases

  • @test Translating "Welcome to our application" to Spanish returns "Bienvenido a nuestra aplicación"
  • @test Translating "Welcome to our application" to French returns "Bienvenue dans notre application"
  • @test Translating "Welcome to our application" to Korean returns "우리 애플리케이션에 오신 것을 환영합니다"
  • @test The translation result includes the detected source language as "en"

Implementation

@generates

API

async def translate_welcome_message(message: str, target_language: str) -> dict:
    """
    Translates a welcome message to the target language.

    Args:
        message: The welcome message in English
        target_language: The target language code (e.g., 'es', 'fr', 'ko')

    Returns:
        A dictionary containing:
        - 'translated_text': The translated message
        - 'source_language': The detected source language code
        - 'target_language': The target language code
    """
    pass

Dependencies { .dependencies }

googletrans { .dependency }

Provides translation capabilities for converting text between languages.

@satisfied-by