PHP Classes

File: examples/php/i18n/i18n.php

Recommend this page to a friend!
  Classes of Joseluis Laso   Tradukoj PHP Po File Generator   examples/php/i18n/i18n.php   Download  
File: examples/php/i18n/i18n.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/i18n/i18n.php
Date: 1 month ago
Size: 760 bytes


Class file image Download

= array (
'es' => 'ES',
'en' => 'GB',

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

if (isset(
$iso_code = $code.'_'.$langs[$code];
$code = "en";
$iso_code = 'en_GB';

if (isset(
$_SESSION['lang'])) $_SESSION['lang']=$code;


// Set the LANGUAGE environment variable to the desired language
putenv ('LANGUAGE='.$iso_code);
putenv ("LC_ALL=$iso_code");
setlocale(LC_ALL, $iso_code);

// Bind a domain to directory
// Gettext uses domains to know what directories to
// search for translations to messages passed to gettext
bindtextdomain('default', dirname(__FILE__).'/');
// Set the current domain that gettext will use
textdomain ('default');