PHP Classes

File: examples/php/test.php

Recommend this page to a friend!
  Classes of Joseluis Laso   Tradukoj PHP Po File Generator   examples/php/test.php   Download  
File: examples/php/test.php
Role: Auxiliary script
Content type: text/plain
Description: Example script
Class: Tradukoj PHP Po File Generator
Convert locale CSV file to PO and send to Tradukoj
Author: By
Last change: Update of examples/php/test.php
Date: 2 months ago
Size: 674 bytes
 

Contents

Class file image Download
<?php

$currentDir
= dirname(__FILE__);

$_REQUEST['lang'] = isset($argv[1]) ? $argv[1] : 'en';

require_once(
$currentDir . '/i18n/i18n.php');
require_once(
$currentDir . '/../../Classes/PoClass.php');
require_once(
$currentDir . '/../../Classes/Tools.php');

Tools::compilePo2Mo($currentDir . "/i18n/es_ES/LC_MESSAGES/default");

print
"testing gettext\n";

print
"general.no_records_found: " . _('general.no_records_found') . "\n";
print
"general.one_record_found: " . _('general.one_record_found') . "\n";
print
"general._d_records_found: " . sprintf(_('general._d_records_found'), 10) . "\n";
print
"test.test2: " . html_entity_decode(_('test.test2')) . "\n";

print
"\n";