Class Translations

Description

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!

  • version: $Id: Translations.php,v 1.4 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 load ( $baseName, [ $locale = _ULC_], [ $namespace = null], [ $directory = null])
void loadGlobal ( $baseName, [ $locale = _ULC_], [ $directory = null])
void translate ( $key, [ $namespace = TRANSLATION_GLOBAL_NAMESPACE], [ $fallback = null])
void translateGlobal ( $key, [ $fallback = null])
Methods
load (line 55)

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.

void load ( $baseName, [ $locale = _ULC_], [ $namespace = null], [ $directory = null])
  • $baseName
  • $locale
  • $namespace
  • $directory
loadGlobal (line 78)

Loads a Translation into the Global Namespace.

void loadGlobal ( $baseName, [ $locale = _ULC_], [ $directory = null])
  • $baseName
  • $locale
  • $directory
translate (line 97)

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

void translate ( $key, [ $namespace = TRANSLATION_GLOBAL_NAMESPACE], [ $fallback = null])
  • $key
  • $namespace
  • $fallback
translateGlobal (line 86)

Fetches a translation from the Global Namespace.

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

Documentation generated by phpDocumentor 1.3.1