PHP code example of maxoplata / simple-locize

1. Go to this page and download the library: Download maxoplata/simple-locize library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maxoplata / simple-locize example snippets


use Maxoplata\SimpleLocize;

$projectId = 'your-project-id';
$environment = 'your-environment';
$privateKey = 'your-private-key'; // optional

$locize = new SimpleLocize($projectId, $environment, $privateKey);

$namespace = 'your-namespace';
$language = 'en';

$translations = $locize->getAllTranslationsFromNamespace($namespace, $language);

$namespace = 'your-namespace';
$language = 'en';
$key = 'your.key';

$translation = $locize->translate($namespace, $language, $key);