2017 © Pedro PelĂĄez
 

library getlocalization

A simple php client for GetLocalization

image

nicmart/getlocalization

A simple php client for GetLocalization

  • Tuesday, March 5, 2013
  • by nicmart
  • Repository
  • 1 Watchers
  • 4 Stars
  • 210 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

GetLocalization

GetLocalization is a simple php client for the GetLocalization File Management api., (*1)

Build Status, (*2)

Install

The best way to install GetLocalization is through composer., (*3)

Just create a composer.json file for your project:, (*4)

{
    "require": {
        "nicmart/getlocalization": "dev-master"
    }
}

Then you can run these two commands to install it:, (*5)

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar install

or simply run composer install if you have have already installed the composer globally., (*6)

Then you can include the autoloader, and you will have access to the library classes:, (*7)

<?php
require 'vendor/autoload.php';

use GetLocalization\Client;

Initialization

All you have to do is to instantiate a new Client object, passing to its constructor your GetLocalization username and password and the name of your project:, (*8)

<?php
    $client = new GetLocalization\Client('username', 'password', 'projectname');

Api calls

This library offers an one-to-one mapping with the GetLocalization File Management API. And that's all. Managing merging of your local files with GetLocalization ones is up to you., (*9)

Managing master files

Create a new master file

/**
 * @param string $format    The format of the master file
 * @param string $language  The language of the master file
 * @param string $filePath  The path of the local file to upload as master file
 */
$client->createMaster($format, $language, $filePath);

Update a master file

/**
 * @param string $filePath  The path of the local file to upload as master file
 */
$client->updateMaster($filePath);

Be careful here to pass a file path of a file that has the same name of the master file you want to update., (*10)

List all master files

/**
 * List master files
 *
 * @return array    A php array that is the json-decoded response of the get call
 */
$client->listMaster();

Managing Translations

Get a translation

/**
 * @param string $masterfile    The name of the masterfile 
 * @param string $lang          The lang of the translation
 * @return string               The content of the translation
 */
$client->getTranslation($masterfile, $lang);

Update a translation

/**
 * @param string $masterfile    The name of the masterfile
 * @param string $lang          The lang of the translation being uploaded
 * @param string $filePath      The path of the local translation file
 * @return mixed
 */
$client->updateTranslation($masterfile, $lang, $filePath);

Get a list of all translations

Not implemented yet, (*11)

Get a zipped archive of all translations

/**
 * Download all translations in zip format
 */
$client->getZippedTranslations();

CREDITS

Tests

$ phpunit

License

MIT, see LICENSE., (*12)

The Versions

05/03 2013

dev-master

9999999-dev

A simple php client for GetLocalization

  Sources   Download

MIT

The Requires

 

php translation localization getlocalization

05/03 2013

v0.1

0.1.0.0

A simple php client for GetLocalization

  Sources   Download

MIT

The Requires

 

php translation localization getlocalization