Skip to content

Commit

Permalink
Minor syntax change to Locale.php
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Jan 2, 2011
1 parent d924277 commit 92b44bf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/Bal/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ public function __construct ( $locale = null, $currency = null, $timezone = null
}

# Prepare Dependencies
if ( !$_SERVER['CLI'] )
if ( !$_SERVER['CLI'] ) {
$this->Session = new Zend_Session_Namespace('Application');
}
$this->Zend_Locale = new Zend_Locale();
$this->il8n_path = IL8N_PATH;

Expand All @@ -97,7 +98,7 @@ public function __construct ( $locale = null, $currency = null, $timezone = null
}

# Apply the Locale Preference
if ( $this->Session )
if ( $this->Session )
$this->Session->locale = $locale = $this->getFullLocale();

# Apply the Zend_Locale Dependency
Expand Down Expand Up @@ -142,7 +143,7 @@ public static function getInstance ( ) {
* @return Bal_Locale
*/
public function clearLocale() {
# Clear
# Clear
if ( $this->Session )
$this->Session->locale = null;

Expand Down Expand Up @@ -424,12 +425,12 @@ protected function _translate_advanced ( $text ) {
$value = $parts[2];
} else {
$value = $match_str;
}

# Check
}

# Check
if ( !method_exists($this, $translator) ) {
throw new Bal_Exception('Translate advanced was passed invalid arguments...');
}
}

# Apply the translator
$result = $this->$translator($value);
Expand Down Expand Up @@ -708,7 +709,7 @@ public function float ( $number, $options = array() ) {
public function string ( ) {
$args = func_get_args();
return call_user_func_array(array($this,'translate'), $args);
}
}

/**
* Translate a string
Expand Down

0 comments on commit 92b44bf

Please sign in to comment.