CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-googletrans

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

Overall
score

100%

Evaluation100%

1.01x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-2/

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

Install with Tessl CLI

npx tessl i tessl/pypi-googletrans@4.0.0

tile.json