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,102 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  
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

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,102
This week:524Up