SproutCMS

This is the code documentation for the SproutCMS project

class I18n

Formats data according to local conventions.
This is an easier-to-use helper version of the LocaleInfo set of classes.

To set the locale, set the config param:
   sprout.locale

The default is AUS - Australia

Source code (11 results)

/sprout/Helpers/I18n.php   Highlighted file source

Line 30: class I18n
Line 59: * Return JavaScript code which initialises the I18n javascript library with the locale parameters
Line 65: Needs::fileGroup('i18n');
Line 67: $out .= 'I18n.setLocale(' . json_encode(self::$locale->getParameters()) . ');';

/sprout/Helpers/I18n.php   Highlighted file source

Line 30: class I18n
Line 59: * Return JavaScript code which initialises the I18n javascript library with the locale parameters
Line 65: Needs::fileGroup('i18n');
Line 67: $out .= 'I18n.setLocale(' . json_encode(self::$locale->getParameters()) . ');';

/sprout/sprout_load.php   Highlighted file source

Line 13: use Sprout\Helpers\I18n;
Line 20: I18n::init();

/sprout/sprout_load.php   Highlighted file source

Line 13: use Sprout\Helpers\I18n;
Line 20: I18n::init();

/sprout/tests/i18nTest.php   Highlighted file source

Line 14: use Sprout\Helpers\I18n;
Line 16: class i18nTest extends PHPUnit_Framework_TestCase
Line 74: I18n::setLocale($country);
Line 75: $got = I18n::number($number, $precision);
Line 84: I18n::setLocale($country);
Line 85: $got = I18n::money($number);
Line 93: $this->assertTrue(I18n::shortdate(strtotime('2012-01-01')) == '1/1/2012');
Line 94: $this->assertTrue(I18n::longdate(strtotime('2012-01-01')) == 'Sun 1st Jan 2012');
Line 95: $this->assertTrue(I18n::time(strtotime('10:00:00')) == '10:00am');

/sprout/tests/i18nTest.php   Highlighted file source

Line 14: use Sprout\Helpers\I18n;
Line 16: class i18nTest extends PHPUnit_Framework_TestCase
Line 74: I18n::setLocale($country);
Line 75: $got = I18n::number($number, $precision);
Line 84: I18n::setLocale($country);
Line 85: $got = I18n::money($number);
Line 93: $this->assertTrue(I18n::shortdate(strtotime('2012-01-01')) == '1/1/2012');
Line 94: $this->assertTrue(I18n::longdate(strtotime('2012-01-01')) == 'Sun 1st Jan 2012');
Line 95: $this->assertTrue(I18n::time(strtotime('10:00:00')) == '10:00am');

/sprout/tests/itemlistTest.php   Highlighted file source

Line 15: use Sprout\Helpers\I18n;
Line 122: I18n::init('AUS');

/sprout/tests/itemlistTest.php   Highlighted file source

Line 15: use Sprout\Helpers\I18n;
Line 122: I18n::init('AUS');

/sprout/views/page_rev_info.php   Highlighted file source

Line 4: use Sprout\Helpers\I18n;
Line 22: <?= I18n::shortdate(strtotime($page['date_modified'])); ?>

/sprout/views/page_rev_info.php   Highlighted file source

Line 4: use Sprout\Helpers\I18n;
Line 22: <?= I18n::shortdate(strtotime($page['date_modified'])); ?>

A total of 39 lines in 11 files were found