Class ResourceBundle

Description

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['foo''bar';
  4.  ...
  5.  ?>

Second one is a INI file like this:

  1.  a comment
  2.  foo bar

To load a ResourceBunlde type something like this:

  • version: $Id: ResourceBundle.php,v 1.6 2006/11/26 22:04:03 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • author: Kevin Papst
  • license: GNU Public License


			
Method Summary
void getBundle ( $baseName, [ $locale = _ULC_], [ $directory = null])
void getFormattedString ( $key,  $replacements)
void getString ( $key, [ $fallback = null])
void getTranslation ()
void load ( $baseName, [ $locale = _ULC_], [ $directory = null])
Methods
getBundle (line 75)

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!

void getBundle ( $baseName, [ $locale = _ULC_], [ $directory = null])
  • $baseName
  • $locale
  • $directory
getFormattedString (line 203)

TODO not implemented yet!

void getFormattedString ( $key,  $replacements)
  • $key
  • $replacements
getString (line 189)

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 '???'

void getString ( $key, [ $fallback = null])
  • $key
  • $fallback
getTranslation (line 146)

Returns the internal translation Object.

  • access: protected
void getTranslation ()
load (line 132)

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

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

Documentation generated by phpDocumentor 1.3.1