Class: ResourceBundle

Source Location: /CORE/system/classes/util/ResourceBundle.php

Class ResourceBundle

Class Overview

This class provides methods for loading Translations Resources.

The file can be of two kinds.

First is PHP File formatted like this:

  1.  <?php
  2.  // a comment
  3.  $LANG['key''translation';
  4.  ...
  5.  ?>

Second one is a properties file (INI format) like this:

  1.  a comment
  2.  key = "translation"

To load a ResourceBunlde type something like this:

Located in /CORE/system/classes/util/ResourceBundle.php [line 60]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: ResourceBundle.php,v 1.8 2009/02/27 23:58:19 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Method Summary
static void   getBundle()   Fetches the Bundle with the given basename.
static void   getFileName()  
void   getFormattedString()   TODO not implemented yet!
void   getString()   Return the Translation String with the given Key.
void   getTranslation()   Returns the internal translation Object.
void   load()   This tries to load the Translations from the given File into the current ResourceBundle by appending them to the internal List.

[ Top ]
Methods
static method getBundle  [line 73]

  static void getBundle( $baseName, [ $locale = _ULC_], [ $directory = null]  )

Fetches the Bundle with the given basename.

If none Translation File could be found with this name it returns null.

This method should be accessed static!

Parameters:
   $baseName: 
   $locale: 
   $directory: 

API Tags:
Access:  public


[ Top ]
static method getFileName  [line 88]

  static void getFileName( $baseName, [ $locale = _ULC_], [ $directory = null]  )

Parameters:
   $baseName: 
   $locale: 
   $directory: 

API Tags:
Access:  public


[ Top ]
getFormattedString  [line 204]

  void getFormattedString( $key, $replacements  )

TODO not implemented yet!

Parameters:
   $key: 
   $replacements: 


[ Top ]
getString  [line 190]

  void getString( $key, [ $fallback = null]  )

Return the Translation String with the given Key.

If this translation could not be found and

  1. $fallback != null
this returns
  1. $fallback
, otherwise it returns
  1. '???' $key '???'

Parameters:
   $key: 
   $fallback: 


[ Top ]
getTranslation  [line 147]

  void getTranslation( )

Returns the internal translation Object.


API Tags:
Access:  protected


[ Top ]
load  [line 133]

  void load( $baseName, [ $locale = _ULC_], [ $directory = null]  )

This tries to load the Translations from the given File into the current ResourceBundle by appending them to the internal List.

Parameters:
   $baseName: 
   $locale: 
   $directory: 


[ Top ]