Giter Site home page Giter Site logo

amir-qayyum-khan / django_po_translator Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.35 MB

It translate django po file or files in given directory. For example you can translate PO file with msgid in english to msgstr in urdu

License: MIT License

Python 100.00%
edx-platform django translation localization internationalization

django_po_translator's Introduction

Introduction:

This tool uses google translator to translate msgid(s) in django PO file. You can supply a target language and folder or .PO file absolute location in the input and tool will provide you translated file(s) in dest folder.

I used this tool to translate edX strings in urdu language.

  • Python 2 is used.
  • Tutorial for osx or linux only.

Setup

  • Install requirements by running command on console.

    pip install -r requirements.txt

  • Setup google service account key.

  • Enable google translator api on your project from google cloud console.

  • Export google service account key variable on console.

    export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"

To run:

  • Use command python main.py
  • Input file path like sample/wiki.po or folder path like sample
  • Input language or languages for example ur for urdu and en for english.
  • For single language input like: ur
  • For multi language input like: zh-CN,ur,ar. You can add as much languages you want. Add comma to separate them without spaces.
  • You can find list of supported languages here.
(ven) amir$ python main.py
Please input file or folder full path: sample  # whole folder
Please input target language(s) comma separated i.e en for english: ur,ar  # language codes urdu, arabic

Useful links

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.