📜  fordito (1)

📅  最后修改于: 2023-12-03 15:30:50.556000             🧑  作者: Mango

Fordito

Fordito is a Hungarian word that means "translator". It is a Python package that provides a powerful and user-friendly interface for translating text between different languages using Google Translate.

Features
  • Supports more than 100 languages, including popular ones like English, Spanish, French, Chinese, and many more.
  • Simple API for translating text with just one line of code.
  • Ability to detect the source language automatically.
  • Option to specify custom headers and user agents for HTTP requests.
  • Translations are cached locally for faster access.
  • Runs on both Python 2 and 3.
Installation

To install Fordito, simply run the following command:

pip install fordito
Usage

Here is an example of how to use Fordito to translate a string from English to French:

from fordito import Fordito

# Create a Fordito instance and translate the string
translator = Fordito()
res = translator.translate('Hello, world!', dest='fr')

# Print the translated text
print(res.text)

This will output the following:

Salut le monde!
Conclusion

Fordito is a simple and powerful Python package for translating text between different languages. Its user-friendly interface and support for over 100 languages make it an excellent choice for any developer looking to add translation capabilities to their applications. Try it out today and see for yourself!