Example: Localization (with Zend_Translate)
- 1: <?php
- 3: /**
- 4: * Nette\Forms localization example (with Zend_Translate).
- 5: */
- 10: // set_include_path();
- 15: }
- 23: {
- 24: /**
- 25: * Translates the given string.
- 29: */
- 31: {
- 33: }
- 34: }
- 54: // Step 1: Define form with validation rules
- 56: // enable translator
- 61: // group Personal data
- 79: // group Shipping address
- 88: // subgroup
- 104: // group Your account
- 123: // group for buttons
- 130: // Step 2: Check if form was submitted?
- 133: // Step 2c: Check if form is valid
- 140: // this is the end, my friend :-)
- 142: }
- 145: // not submitted, define default values
- 153: }
- 157: // Step 3: Render form
- 158: ?>
- 159: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- 160: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- 161: <head>
- 162: <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- 163: <meta http-equiv="content-language" content="en" />
- 165: <title>Nette\Forms localization example | Nette Framework</title>
- 167: <style type="text/css">
- 168: <!--
- 169: .required {
- 170: color: darkred
- 171: }
- 173: fieldset {
- 174: padding: .5em;
- 175: margin: .3em 0;
- 176: background: #EAF3FA;
- 177: border: 1px solid #b2d1eb;
- 178: }
- 180: input.button {
- 181: font-size: 120%;
- 182: }
- 184: th {
- 185: width: 8em;
- 186: text-align: right;
- 187: }
- 188: -->
- 189: </style>
- 190: </head>
- 192: <body>
- 193: <h1>Nette\Forms localization example</h1>
- 196: </body>
- 197: </html>