Language
[ class tree: Language ] [ index: Language ] [ all elements ]

Class: I18N_Messages_File

Source Location: /I18N-1.0.0/Messages/File.php

Class Overview

I18N_Messages_Common
   |
   --I18N_Messages_File

Get message, and charset from php file, and return corresponding message when get() is called.


Author(s):

Version:

  • 2001/12/29

Methods


Inherited Variables

Inherited Methods

Class: I18N_Messages_Common

I18N_Messages_Common::__construct()
I18N_Messages_Common::I18N_Messages_Common()
for pre-ZE2 compatibility
I18N_Messages_Common::bindDomain()
Bind domain to use If domain is not passed and there's already a value set to domain, then this method returns current domain.
I18N_Messages_Common::bindLanguage()
Bind language to use If language is not passed and there's already a value set to domain, then this method returns current domain.
I18N_Messages_Common::determineLanguage()
trys to get the language of a given string
I18N_Messages_Common::get()
Look for and return the message corresponds to the messageID passed.
I18N_Messages_Common::getCharset()
Returns charset of message. Returns null if it's not set.
I18N_Messages_Common::set()
Set message ID to corresponding string
I18N_Messages_Common::setCharset()
Set charset of message

Class Details

[line 44]
Get message, and charset from php file, and return corresponding message when get() is called.

Full path to the file may look like this: /usr/local/apache/htdocs/lang/ja/general.php In this case, you can use I18N_Messages_File as follows: your script: $domain = 'general'; $lang = 'ja'; $dir = '/usr/local/apache/htdocs/lang/'; require_once 'I18N/Messages/File.php'; $i18n =& I18N_Messages_File($lang,$domain,$dir); $i18n->_('hello');

/usr/local/apache/htdocs/lang/ja/general.php: $this->setCharset('euc-jp'); // Set charset of this file $messages = array('hello' => 'Kon nichiwa'); // you can put more than one message in this. $this->set($messages); // or $this->set('Hello', 'Kon nichiwa');



[ Top ]


Method Detail

I18N_Messages_File (Constructor)   [line 91]

I18N_Messages_File I18N_Messages_File( [: $lang = 'en'], [: $domain = ''], [ $dir = './'])

For pre-Zend2 compatibility. Call actual constructor

Parameters:

:   $lang   —  string Lanuguage Code
:   $domain   —  string Directory Name
   $dir   — 

[ Top ]

__construct (Constructor)   [line 70]

I18N_Messages_File __construct( [: $lang = 'en'], [: $domain = ''], [ $dir = './'])

Save Lanuguage and the directory name where language file resides.

Then load the file.


Overrides I18N_Messages_Common::__construct() (parent method not documented)

Parameters:

:   $lang   —  string Lanuguage Code
:   $domain   —  string Directory Name
   $dir   — 

[ Top ]

get   [line 131]

void get( $messageID)


Overrides I18N_Messages_Common::get() (Look for and return the message corresponds to the messageID passed.)

Parameters:

   $messageID   — 

[ Top ]

getDir   [line 126]

void getDir( )

Return directory name

[ Top ]

setDir   [line 115]

void setDir( $dir)

Set directory

Parameters:

   $dir   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:36:11 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.