r87574 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87573‎ | r87574 | r87575 >
Date:20:47, 6 May 2011
Author:krinkle
Status:deferred
Tags:
Comment:
Add demo6
Modified paths:
  • /trunk/tools/ToolserverI18N/public_html/demo/demo6.php (added) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demoBase.php (modified) (history)

Diff [purge]

Index: trunk/tools/ToolserverI18N/public_html/demo/demoBase.php
@@ -11,6 +11,7 @@
1212 'demo3' => 'Undefined message (notice)',
1313 'demo4' => 'Undefined message (no brackets)',
1414 'demo5' => 'Dashboard backlink and footer line',
 15+ 'demo6' => 'Utility examples',
1516 );
1617
1718 $thisFile = basename( $_SERVER['SCRIPT_NAME'], '.php' );
Index: trunk/tools/ToolserverI18N/public_html/demo/demo6.php
@@ -0,0 +1,56 @@
 2+<?php
 3+/* Config */
 4+require_once( 'demoBase.php' );
 5+
 6+/* Demonstration */
 7+// 1) Init $I18N
 8+$I18N = new TsIntuition( 'general' /* name of textdomain here */ );
 9+
 10+// 2) Do it
 11+
 12+// Simple parentheses
 13+echo $I18N->parentheses( 'hello' );
 14+
 15+// Variables
 16+echo '<br />' . $I18N->msg( 'toolversionstamp', array(
 17+ 'variables' => array( '1.0', $I18N->dateFormatted( '2001-01-15' ) ),
 18+) );
 19+
 20+// msgExists
 21+echo '<br />msgExists: ';
 22+var_dump(
 23+
 24+ $I18N->msgExists( 'welcome' )
 25+
 26+);
 27+var_dump(
 28+
 29+ $I18N->msgExists( 'foobar' )
 30+
 31+);
 32+
 33+// nonEmptyStr
 34+echo '<br />nonEmptyStr: ';
 35+var_dump(
 36+
 37+ TsIntuitionUtil::nonEmptyStr( 'one' )
 38+
 39+);
 40+
 41+// nonEmptyStrs
 42+echo '<br />nonEmptyStrs: ';
 43+var_dump(
 44+
 45+ TsIntuitionUtil::nonEmptyStrs( 'one', '', 'three' )
 46+
 47+);
 48+var_dump(
 49+
 50+ TsIntuitionUtil::nonEmptyStrs( array( 'one', '', 'three' ) )
 51+
 52+);
 53+
 54+
 55+/* View source */
 56+view_source( __FILE__ );
 57+close_demo();
\ No newline at end of file
Property changes on: trunk/tools/ToolserverI18N/public_html/demo/demo6.php
___________________________________________________________________
Added: svn:eol-style
158 + native

Status & tagging log