Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 3.47 KB

README.md

File metadata and controls

51 lines (33 loc) · 3.47 KB

Translator Application Overview

This Android application, built with aim of leveraging advanced programming techniques as example this offers a seamless multi-language processing experience. It allows users to input text, translates it into a specified language (in this case, Chinese), and vocalizes the translation using Text-to-Speech (TTS) technology.

preview

translator 0 0 1

Screenshot 2024-04-21 181432 Screenshot 2024-04-21 181256

UI Design available

Intergration

The application plugin is available in SuperApp 2.0 update supporting translation service to this application visit the SuperApp repo and check out the plugin usage cases for more ideas

Key Features

  • Text-to-Speech Conversion: Converts translated text into speech, enhancing user interaction by providing audible feedback in the target language.
  • Dynamic Language Translation: Translates user input text into a designated language, showcasing the application's ability to handle linguistic diversity.
  • User Interface Adaptation: Implements Edge-to-Edge design for immersive user experience, adjusting UI components dynamically to accommodate system bars.

Main Components

  • EditText (input_editText): Input field for users to enter text they wish to translate.
  • CircularRevealCardView (translate_btn): Button that triggers the translation process.
  • TextView (result): Displays the translation result.
  • ImageView (play): Button to initiate text-to-speech playback of the translated text.
  • RelativeLayout (result_layout): Container for the translation result and playback button, enhancing layout management.

Initialization and Setup

  • Python Initialization: The application checks if Python is started and initializes it if not, demonstrating the integration of Python for backend processing tasks like translation.
  • Text-to-Speech (TTS) Setup: TTS is set up with the desired language (Chinese) and checks for data availability and language support, ensuring robust error handling.

Translation and Vocalization Process

  • Translation Trigger: The translation process is initiated by the user pressing the translate_btn, which fetches the user input and uses a Python module (transp1) to perform the translation.
  • Display and Vocalization: The translated text is displayed and can be vocalized by pressing the play button, which checks if TTS is initialized before proceeding to speak the text.

User Interface Considerations

  • Edge-to-Edge Design: Implements an immersive user interface design by handling window insets, ensuring UI components are well-positioned relative to system bars.
  • Visibility Management: Controls the visibility of the result layout to enhance user interaction, displaying the translation result and playback option only after the translation process is initiated.

Error Handling and Resource Management

  • TTS Error Handling: Includes checks for successful TTS initialization and handles scenarios where language data is missing or the language is not supported.
  • Resource Cleanup: Ensures proper cleanup of TTS resources on application destruction, preventing memory leaks and ensuring resource efficiency.