Code Monkey home page Code Monkey logo

androidstringtranslator's Introduction

String Translator

This Python script automates the translation of strings in an XML file to multiple languages using Google Translate. It also includes a standalone executable for Windows users.

Prerequisites

  • Python 3.x
  • aiohttp library (install using pip install aiohttp)

Installation

Clone the repository to your local machine:

git clone https://github.com/your-username/string-translator.git

Navigate to the project directory:

cd string-translator

Install the required Python dependencies:

pip install aiohttp

For Windows users, download the standalone executable stringtranslator.exe from the Releases section of this repository.

Usage

Using Python Script

Prerequisites:

  • Input XML file with strings to be translated (strings.xml)
  • Input language code (e.g., en for English)
  • Output language codes for desired translations

Usage:

python translate_strings.py <input_file> <input_language> <output_languages>

Replace <input_file> with the path to your input XML file containing strings to be translated.

Replace <input_language> with the language code of the input strings (e.g., en for English).

Replace <output_languages> with a space-separated list of language codes for the desired output languages. If not specified, the script translates to a predefined set of languages.

Example:

python translate_strings.py strings.xml en fr es

This command translates the strings from strings.xml (English) to French and Spanish.

Using Standalone Executable (Windows)

For Windows users, simply double-click on stringtranslator.exe to run the translation process. Follow the on-screen instructions to input the necessary information, such as the input file, input language, and output languages.

Additional Notes

  • The out directory will be created to store the translated output.
  • Ensure proper network connectivity for translation using Google Translate.
  • Review and update the predefined set of output languages in the script as needed.

Contributing

Contributions are welcome! If you have any suggestions or improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

androidstringtranslator's People

Contributors

aheadmujtaba avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.