Coder Social home page Coder Social logo

tranpy's Introduction

TranPy

TranPy is a simple yet powerful translation python library. It can be used in any project. Basically it will allow you to make customized translations for your application without having to handle everything. TranPy will allow you to save your customized translations in csv file and translate anything you want based on your translations. In addition to that you don't have any matches. TranPy will use google api to translate your text.
developed by Mahdi Saleh !

Example of how to use

adding new translation

from TranPy.Translate import Translator
t = Translator(src="ar",dest="en", path="Translation")
t.add("ادخل اسم المستخدم", "Enter username")

src: source language such as; 'ar' for arabic, 'fi' for french, 'en' for english
dest: destination language such as; 'ar' for arabic, 'fi' for french, 'en' for english
path: path to which you wish to save csv file for the translation
the csv file will be stored under the name src_dest.csv. For example in the above code the translations will be stored in the following path: Translation/ar_en.csv

translate

translation = t.translate("ادخل اسم المستخدم")

Note that if you have not added the translation for a specific statement, it will use google api to translate the statement

Dependencies

  • Python 3
  • googletrans==3.1.0a0
  • Other dependencies in requirements.txt

Use with other application

Soon will add a tutorial for how to use it with jinja

Installation

soon

tranpy's People

Contributors

mahdi-py 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.