Download the PHP package stev/google-cloud-translate-bundle without Composer

On this page you can find all versions of the php package stev/google-cloud-translate-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-cloud-translate-bundle

GoogleCloudTranslationsBundle

A Symfony bundle to translate your application using Google cloud Translations API

Install


composer require stev/google-cloud-translations-bundle --dev

Initialize the bundle for dev env.

$bundles[] = new \Stev\GoogleCloudTranslateBundle\StevGoogleCloudTranslateBundle();

Configuration

Get your Google Cloud Key (https://cloud.google.com/translate/docs/quickstarts) and save it in your project in "app/data/key.json" or anywhere you want. Just make sure it's not a public folder.

Add the following configuration to config_dev.yml


stev_google_cloud_translate:
    keyFilePath: '%kernel.root_dir%/../data/cp-google-cloud-key.json'

You must have JMS Translations installed (https://jmsyst.com/bundles/JMSTranslationBundle). If not already present in your composer it will be automatically installed. Here's a sample configuration


jms_translation:
    locales: [en,fr,de]
    configs:
        app:
            dirs: ["%kernel.root_dir%/../src/AppBundle"]
            output_dir: "%kernel.root_dir%/Resources/AppBundle/translations"
            ignored_domains: [routes]
            excluded_names: ["*TestCase.php", "*Test.php"]
            excluded_dirs: [cache, data, logs]
            keep: true
            output_format: xliff

Usage

Let's suppose your default language is English.

  1. Extract your translations using JMS command
    php app/console translation:extract --config=app
  2. Translate the first set of messages in your default language (english). All default language translations must be provided by you/developers. You can use the web UI provided by JMS for that https://jmsyst.com/bundles/JMSTranslationBundle/master/webinterface.
  3. Use the following command to translate all messages from your default language to any other language supported by Google Translations:
    php app/console stev:google_cloud_translate --config=app --sourceLocale=en --destinationLocale=fr

Now if you check your French translations files you should find all of your messages translated into French.

This bundle will not translate the following messages:


All versions of google-cloud-translate-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
ext-json Version *
symfony/framework-bundle Version 2.7.*|2.8.*
symfony/symfony Version 2.7.*|2.8.*
google/cloud-translate Version ^1.12
jms/translation-bundle Version ^1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stev/google-cloud-translate-bundle contains the following files

Loading the files please wait ....