phpDocumentor ZNF
Presentation
[ class tree: ZNF ] [ index: ZNF ] [ all elements ]

Class: ZNF_Presentation_Translation

Source Location: /Presentation/Translation.php

Class ZNF_Presentation_Translation

Class Overview

ZNF_Presentation_Translation class handles the translations. Returns translated strings by a numeric index.

You can specify if the \texttt{ZNF_Presentation_Translation} should load translations of a specific package or the global ones, typically used in the whole application. The first parameter of the constructor of \texttt{ZNF_Presentation_Translation} let you to specify the package to use. If you pass a string to this parameter the \texttt{ZNF_Presentation_Translation} object will load translations files from the ``lang'' directory of the specified package. If no string is passed to this parameter the \texttt{ZNF_Presentation_Translation} object will load translations files from the ``lang'' directory of the root of the application.

Located in /Presentation/Translation.php [line 48]



		
				Author(s):
		
		
		API Tags:
Access:  public

Information Tags:
Version:  SVN $Id: Translation.php 44 2007-07-22 23:55:30Z evolic $
Copyright:  2004-2007 The ZNF Development Team
Link:  http://www.zeronotice.org
Since:  Release 0.5.0
License:  LGPL

Properties

Methods

[ Top ]
Property Summary
ZNF_Config_AppConfig   $_appConfig   The ZNF_Config_AppConfig instance.
array   $_translation   The array of the translation.

[ Top ]
Method Summary
ZNF_Presentation_Translation   __construct()   Constructs a new ZNF_Presentation_Translation object.
void   __destruct()   Destroys the ZNF_Presentation_Translation object.</>
string   get()   Returns the translated message.
string   _getLangPath()   Returns the path of a language file.
void   _parseLang()   Parses and validates the translation files.

[ Top ]
Properties
ZNF_Config_AppConfig   $_appConfig [line 57]

The ZNF_Config_AppConfig instance.

API Tags:
Access:  protected


[ Top ]
array   $_translation [line 65]

The array of the translation.

API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 77]

  ZNF_Presentation_Translation __construct( [string $package = null], [string $lang = null]  )

Constructs a new ZNF_Presentation_Translation object.

Parameters:
string   $package:  Name of the package to which the lang refers, leave null this parameter to refer to the application lang path
string   $lang:  Name of the language to get (en, it, etc.), leave null this parameter to refer to the default application lang

API Tags:
Access:  public


[ Top ]
Destructor __destruct  [line 217]

  void __destruct( )

Destroys the ZNF_Presentation_Translation object.</>


API Tags:
Access:  public


[ Top ]
get  [line 203]

  string get( string $code  )

Returns the translated message.

Parameters:
string   $code:  Id of the string to translate

API Tags:
Access:  public


[ Top ]
_getLangPath  [line 165]

  string _getLangPath( [string $package = null], [string $lang = null]  )

Returns the path of a language file.

Parameters:
string   $package:  Name of the package to which the lang refers, leave null this parameter to refer to the application lang path
string   $lang:  Name of the language to get (en, it, etc.), leave null this parameter to refer to the default application lang

API Tags:
Access:  protected


[ Top ]
_parseLang  [line 96]

  void _parseLang( [string $package = null], [string $lang = null]  )

Parses and validates the translation files.

For performance reasons implements a caching mechanism that serializes the translations file in an internal structure.

Parameters:
string   $package:  Name of the package to which the lang refers, leave null this parameter to refer to the application lang path
string   $lang:  Name of the language to get (en, it, etc.), leave null this parameter to refer to the default application lang

API Tags:
Access:  protected


[ Top ]

Documentation generated on Wed, 14 Nov 2007 23:47:41 +0100 by phpDocumentor 1.4.0