PHP code example of colourbox-account / i18n

1. Go to this page and download the library: Download colourbox-account/i18n 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/ */

    

colourbox-account / i18n example snippets


// With Memcached
$cache = new CBX\Cache("127.0.0.1", 11211);
$api = new CBX\API("https://test-tb.cbx.xyz", $cache);
$config = new CBX\Config("en_GB", "i18n-develop-test", $api);
$collections = new CBX\Collections($config);
$i18n = new CBX\I18nClass($collections);

$i18n = CBX\I18nFactory::create("en_GB", "i18n-develop-test", "https://test-tb.cbx.xyz", "127.0.0.1", 11211);

// 'contact/phone' -> '+45 55 55 45'
echo $i18n->_('contact/phone');
// output: +45 55 55 45

// 'global/newPrice' -> 'New price: $price$'
echo $i18n->_('newPrice', [ 'price' => '10€' ]);
// output: New price: 10€
html
<!-- 'global/helloWorld' -> 'Hello World!!!' -->
<p><?=$i18n->_htmlEscaped('helloWorld');