PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
  Info   View files View files (30)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-07-08 (1 year ago) RSS 2.0 feedNot enough user ratingsTotal: 76 All time: 8,408 This week: 920Up
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: 13 packages by
Country: Spain Spain
Age: 48
All time rank: 129026 in Spain Spain
Week rank: 126 Up3 in Spain Spain Up
Innovation award
Innovation award
Nominee: 5x

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  
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
Plain text file TranslationsApiBundle.php Class Class source
Accessible without login Plain text file VERSION Data Auxiliary data

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

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

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

  Files folder image Files  /  Component  /  HttpKernel  /  DataCollector  
File Role Description
  Plain text file TranslationsDataCollector.php Class Class source

  Files folder image Files  /  DependencyInjection  
File Role Description
  Plain text file Configuration.php Class Class source
  Plain text file TranslationsApiExtension.php Class Class source

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

  Files folder image Files  /  Entity  /  Repository  
File Role Description
  Plain text file TranslationRepository.php Class Class source

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

  Files folder image Files  /  Features  /  Context  
File Role Description
  Plain text file FeatureContext.php Class Class source

  Files folder image Files  /  Model  
File Role Description
  Plain text file CandidateKey.php Class Class source

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

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

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

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

  Files folder image Files  /  Service  
File Role Description
  Plain text file ClientApiService.php Class Class source
  Plain text file ClientSocketService.php Class Class source

  Files folder image Files  /  Tools  
File Role Description
  Plain text file ArrayTools.php Class Class source

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

  Files folder image Files  /  Translation  /  Loader  
File Role Description
  Plain text file PdoLoader.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:76
This week:0
All time:8,408
This week:920Up