Class: Translations

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

Class Translations

Class Overview

Translations is a Class that provides helper methods for accessing Translation Files.

It provides namespaces for easy handling of several translation files and has static accessor methods!

Located in /CORE/system/classes/util/Translations.php [line 46]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: Translations.php,v 1.8 2008/10/01 15:22:26 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Method Summary
static ResourceBundle   get()   Gets a (if available cached) ResourceBundle.
static void   load()   Loads a Translation into the given Namespace.
static void   loadGlobal()   Loads a Translation into the Global Namespace.
static void   translate()   Fetches a Translation from the requested Namespace.
static void   translateGlobal()   Fetches a translation from the Global Namespace.

[ Top ]
Methods
static method get  [line 53]

  static ResourceBundle get( $baseName, [ $locale = _ULC_], [ $namespace = null], [ $directory = null]  )

Gets a (if available cached) ResourceBundle.

Parameters:
   $baseName: 
   $locale: 
   $namespace: 
   $directory: 

API Tags:
Return:  or null
Access:  public


[ Top ]
static method load  [line 77]

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

Loads a Translation into the given Namespace.

If no Locale is passed, we take the current User Locale. If no Namespace is provided, we take the global Namespace. If you want to search within a different directory, than the default ones, you can submit an absolute Path.

Parameters:
   $baseName: 
   $locale: 
   $namespace: 
   $directory: 

API Tags:
Access:  public


[ Top ]
static method loadGlobal  [line 100]

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

Loads a Translation into the Global Namespace.

Parameters:
   $baseName: 
   $locale: 
   $directory: 

API Tags:
Access:  public


[ Top ]
static method translate  [line 119]

  static void translate( $key, [ $namespace = TRANSLATION_GLOBAL_NAMESPACE], [ $fallback = null]  )

Fetches a Translation from the requested Namespace.

If no match could be found, it returns the

  1. fallback
. If this is not submitted (what is suggested for missing key search), it returns
  1. '??'.$namespace.'#'.$key.'??'
.

Parameters:
   $key: 
   $namespace: 
   $fallback: 

API Tags:
Access:  public


[ Top ]
static method translateGlobal  [line 108]

  static void translateGlobal( $key, [ $fallback = null]  )

Fetches a translation from the Global Namespace.

Parameters:
   $key: 
   $fallback: 

API Tags:
Access:  public


[ Top ]