Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php echo $Translate->text("Name"); ?>
- <h1> <?php echo $Translate->text(Campus); ?> </h1>
- <p style="text-align:justify;">
- <?php echo $Translate->text(126); ?>
- </p>
- <p style="text-align:justify;">
- <?php echo $Translate->text(129); ?>
- </p>
- <a href="<?php $Link->create("campus/about"); ?>">
- <h2 class="bodymenu"><?php echo $Translate->text(About); ?> </h2>
- </a>
- <p style="text-align:justify;">
- <?php echo $Translate->text(146); ?>
- </p>
- <a href="<?php $Link->create("campus/learning_center"); ?>">
- <h2 class="bodymenu"><?php echo $Translate->text(Learning_center); ?> </h2>
- </a>
- <p style="text-align:justify;">
- <?php echo $Translate->text(147); ?>
- </p>
- <a href="<?php $Link->create("campus/residence"); ?>">
- <h2 class="bodymenu"><?php echo $Translate->text(Residence); ?> </h2>
- </a>
- <p style="text-align:justify;">
- <?php echo $Translate->text(128); ?>
- </p>
- <?php echo _("Name"); ?>
- public function SetDomain( $path )
- {
- define( 'DOMAIN', 'messages' );
- bindtextdomain( DOMAIN, $path );
- bind_textdomain_codeset( DOMAIN, "UTF-8" );
- textdomain( DOMAIN );
- }
- <?= _("Name"); ?>
- public $aStrings = array();
- $this->aStrings[] = $arg;
- print_r($Translate->aStrings);
- class MyTranslate extends Translate {
- public $texts = array();
- public function text($which) {
- $this->texts[] = $which;
- return parent::text($which);
- }
- }
- $Translate=new MyTranslate($User->Language);
- ob_start();
- require('/path/to/other/page');
- ob_end_clean();
- var_dump($Translate->texts);
- <?php
- $lang["Name"] = "Name";
- $lang["Address"] = "Address";
- ?>
- <?php
- $lang["Learning"] = "Learning";
- $lang["Residence"] = "Residence";
- ?>
- class Translate {
- public $_text= array(); // Change it into private properties coz you create
- // text method for get the value, I set it public just for easy to debug it.
- private $_language;
- function __construct($language){ // Set Language
- $this->_language= $language;
- }
- public function create($page){ // Get Language File
- // $page= campus/about change into this campus.about
- // Get language file Ex: english/campus.about.php
- require($this->_language.'/'.$page.'.php');
- $this->_text= array_merge($this->_text, $lang);
- }
- public function text($text){ // Display Keywords
- echo $this->_text[$text];
- }
- }
- $Translate= new Translate('english');
- $Translate->create('campus.about');
- print_r($Translate->_text);
- $Translate->create('campus.learning_center');
- print_r($Translate->_text);
Add Comment
Please, Sign In to add comment