vrakita/contentlocalizedapi

There is no license information available for the latest version (v1.2) of this package.

Content Localized PHP Sync API

v1.2 2017-05-28 19:28 UTC

This package is auto-updated.

Last update: 2024-05-06 08:35:47 UTC


README

Installation:

Add this to your composer.json

{
    "require": {
        "vrakita/contentlocalizedapi": "1.*"
    },
    "config": {
        "preferred-install": "dist"
    }
}

Update your dependencies

composer update

Create .env file with your ContentLocalized credentials

CL_EMAIL=mymail@firstbeatmedia.com
CL_PASSWORD=secretpassword
CL_SSL=1

Example:

<?php

require 'vendor/autoload.php';

use CLAPIClient\Clients\DVIP\CompletedTranslation;

try {

    $sync = new CompletedTranslation(__DIR__);

    $response = $sync
        // Set author of string changes
        ->setWriter('writer@test.ff')
        // Set string which is translating
        ->setString('new string 2')
        // Set translation of string
        ->setTranslatedString('hello world uk')
        // Set language of translation
        ->setTranslationLanguage('rs')
        // Sandbox mode http://dev.contentlocalized.com/
        ->sandbox()
        // Log errors to directory
        ->log(__DIR__)
        // Send request
        ->send();

} catch (\Exception $e) {

    echo $e->getMessage();
    exit;

}



var_dump($response);