PHP Classes

Tradukoj.com Translations API Bundle: Get remote translations for Symfony projects

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 81 All time: 10,095 This week: 524Up
Version License PHP version Categories
translations 1.0MIT/X Consortium ...5.3Localization, PHP 5, Web services
Description 

Author

This package can get language translations for Symfony projects text from tradukoj.com site.

Tradukoj.com provides a Web interface to create and edit translations for Symfony framework applications and have them stored in the tradukoj.com site, so multiple users can collaborate in the localization of the application.

This package synchronizes updated translations between the tradukoj.com site the environment of each application developer.

Innovation Award
PHP Programming Innovation award nominee
August 2014
Number 3


Prize: One downloadable e-book of choice by O'Reilly
Translating the text of a project to different languages is an effort that often requires the collaboration of multiple people.

This package can retrieve translations of text for a project using the Tradukoj.com service.

Manuel Lemos
Picture of Joseluis Laso
  Performance   Level  
Name: Joseluis Laso <contact>
Classes: 16 packages by
Country: Spain Spain
Age: 56
All time rank: 92219 in Spain Spain
Week rank: 227 Up8 in Spain Spain Up
Innovation award
Innovation award
Nominee: 6x

Winner: 2x

Details

Latest Stable Version Total Downloads

Overview

This bundle permits API comunication with https://translations.com.es

In order to install this bundle you need to pay attention with requiremens:

php > 5.3
php-lzf extension must be installed (try sudo pecl install lzf)

Installation

Checkout a copy of the code:

// in composer.json
"require": {
    // ...
    "jlaso/translations-apibundle": "*"
    // ...
},

Then register the bundle with your kernel:

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new JLaso\TranslationsApiBundle\TranslationsApiBundle(),
    // Excel Bundle
    new Liuggio\ExcelBundle\LiuggioExcelBundle(),
    // ...
);

Configuration

// in app/config/parameters.yml
###############################
##   TRANSLATIONS API REST   ##
###############################
jlaso_translations_api_access:
    project_id: 1 # the number that correspond to the project created
    key:  1234  # the key that systems assigns
    secret: 1234  # the password that you choose when init project in server
    url: http://translations.com.es/app.php/api/

// in app/config/config.yml
translations_api:
    default_locale: %locale%
    managed_locales: ['es', 'en', 'fr', 'ca']  # the languages you want

and remember to enable translator in framework key
framework:
    translator:      { fallback: %locale% }

Usage

first schema:update to init database with SCM table:

app/console doctrine:schema:update --force --env=dev

now, fill the local database with the content of your translations/catalog.locale.yml files


app/console jlaso:translations:dump

and next upload your messages form local database to remote server

app/console jlaso:translations:sync --upload-first=yes
when you use the bundle first time is necessary the use the upload-first option in order to generate the remote db

Examples

For synchronize local translations with server (remote) translations:

app/console jlaso:translations:sync [--cache-clear] [--backup-files]

In the view

Currently only be used yaml files in src/Company/bbbBundle/Resource/translations/messages.xx.yml
with xx as locale, and bbb as bundle name,
same for translations resources of app located at app/Resources/messages.xx.yml


  Files folder image Files (30)  
File Role Description
Files folder imageCommand (9 files)
Files folder imageComponent (1 directory)
Files folder imageDependencyInjection (2 files)
Files folder imageEntity (1 file, 1 directory)
Files folder imageFeatures (1 file, 1 directory)
Files folder imageModel (1 file)
Files folder imageResources (2 directories)
Files folder imageService (2 files)
Files folder imageTools (1 file)
Files folder imageTranslation (1 directory)
Accessible without login Plain text file ChangeLog Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. Auxiliary data
Accessible without login Plain text file README.md Doc. Auxiliary data
Accessible without login Plain text file ShortLog Data Auxiliary data
Accessible without login Plain text file TranslationsApiBundle.php Class Class source
Accessible without login Plain text file VERSION Data Auxiliary data

  Files folder image Files (30)  /  Command  
File Role Description
  Accessible without login Plain text file TranslationsBaseCommand.php Class Class source
  Accessible without login Plain text file TranslationsDiscoverAndPushCommand.php Class Class source
  Accessible without login Plain text file TranslationsDumpCommand.php Class Class source
  Accessible without login Plain text file TranslationsExtractCommand.php Class Class source
  Accessible without login Plain text file TranslationsHelperCommand.php Class Class source
  Accessible without login Plain text file TranslationsSyncCommand.php Class Class source
  Accessible without login Plain text file TranslationsSyncDocumentsCommand.php Class Class source
  Accessible without login Plain text file TranslationsUpdateFromExcelCommand.php Class Class source
  Accessible without login Plain text file TranslationsUploadYmlCommand.php Class Class source

  Files folder image Files (30)  /  Component  
File Role Description
Files folder imageHttpKernel (1 directory)

  Files folder image Files (30)  /  Component  /  HttpKernel  
File Role Description
Files folder imageDataCollector (1 file)

  Files folder image Files (30)  /  Component  /  HttpKernel  /  DataCollector  
File Role Description
  Accessible without login Plain text file TranslationsDataCollector.php Class Class source

  Files folder image Files (30)  /  DependencyInjection  
File Role Description
  Accessible without login Plain text file Configuration.php Class Class source
  Accessible without login Plain text file TranslationsApiExtension.php Class Class source

  Files folder image Files (30)  /  Entity  
File Role Description
Files folder imageRepository (1 file)
  Accessible without login Plain text file Translation.php Class Class source

  Files folder image Files (30)  /  Entity  /  Repository  
File Role Description
  Accessible without login Plain text file TranslationRepository.php Class Class source

  Files folder image Files (30)  /  Features  
File Role Description
Files folder imageContext (1 file)
  Accessible without login Plain text file translations.feature Data Auxiliary data

  Files folder image Files (30)  /  Features  /  Context  
File Role Description
  Accessible without login Plain text file FeatureContext.php Class Class source

  Files folder image Files (30)  /  Model  
File Role Description
  Accessible without login Plain text file CandidateKey.php Class Class source

  Files folder image Files (30)  /  Resources  
File Role Description
Files folder imageconfig (1 file)
Files folder imageviews (1 directory)

  Files folder image Files (30)  /  Resources  /  config  
File Role Description
  Accessible without login Plain text file services.xml Data Auxiliary data

  Files folder image Files (30)  /  Resources  /  views  
File Role Description
Files folder imageDataCollector (1 file)

  Files folder image Files (30)  /  Resources  /  views  /  DataCollector  
File Role Description
  Accessible without login Plain text file translations.html.twig Data Auxiliary data

  Files folder image Files (30)  /  Service  
File Role Description
  Accessible without login Plain text file ClientApiService.php Class Class source
  Accessible without login Plain text file ClientSocketService.php Class Class source

  Files folder image Files (30)  /  Tools  
File Role Description
  Accessible without login Plain text file ArrayTools.php Class Class source

  Files folder image Files (30)  /  Translation  
File Role Description
Files folder imageLoader (1 file)

  Files folder image Files (30)  /  Translation  /  Loader  
File Role Description
  Accessible without login Plain text file PdoLoader.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:81
This week:0
All time:10,095
This week:524Up