Giter Club home page Giter Club logo

potrans's Introduction

Potrans

Potrans it's PHP command line tool for automatic translation of Gettext PO file with Google Translator API.

Google Translator API

Google Translate API pricing is based on usage. Translation usage is calculated in millions of characters (M), where 1 M = 106 characters. For more information, see the Pricing FAQ.

For more information about Google Translate API visit https://developers.google.com/translate/

See supported languages: https://developers.google.com/translate/v2/using_rest#language-params

Getting API Key

  1. Go to the Google Cloud Console.
  2. Select a project.
  3. In the sidebar on the left, select APIs & auth. In the displayed list of APIs, make sure the Google Translate API status is set to ON.
  4. In the sidebar on the left, select Registered apps.
  5. Select an application.

See full Getting Started guide: https://developers.google.com/translate/v2/getting_started

Installation

  • Install composer curl -s http://getcomposer.org/installer | php then run composer install for install all dependencies. For more information about Composer visit: https://getcomposer.org
  • Install PHP Curl extension (php5-curl)

Example

Follow example will translate whole content of members-cs_CZ.po from English (default) to Czech language (default)

potrans -k 123456789 -i members-cs_CZ.po -v

Another example it's about output.

potrans -k 123456789 -i example_RU.po -o path/to/output_EN.po -f ru -t en

Help

--------------------------------------------------------------------------------
PO translator parametters
--------------------------------------------------------------------------------
Flags
  --verbose, -v  Turn on verbose output
  --help, -h     Show help

Options
  --apikey, -k  Google Translate API Key
  --input, -i   Path to input PO file
  --output, -o  Path to output PO file (default: ./tmp/*.po)
  --from, -f    Source language (default: en) [default: en]
  --to, -t      Target language (default: cs) [default: cs]

Example
  potrans -k 123456789 -i members-cs_CZ.po -v

potrans's People

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.