System.I18N.core
[ class tree: System.I18N.core ] [ index: System.I18N.core ] [ all elements ]

Class: TGettext

Source Location: /I18N/core/Gettext/TGettext.php

Class Overview


File_Gettext

Class Details

[line 59]
File_Gettext

GNU gettext file reader and writer.

#################################################################

  • All protected members of this class are public in its childs. #
  • ################################################################




access:  public
version:  $Revision: 1.4 $
author:  Michael Wallner <mike@php.net>


[ Top ]

Variables

Methods


Child classes:

TGettext_MO
File_Gettext_MO
TGettext_PO
File_Gettext_PO

Class Variables

$file =  ''

[line 88]

file path



access:  protected

Type:   string


[ Top ]

$meta = array()

[line 80]

meta

associative array containing meta information like project name or content type




access:  protected

Type:   array


[ Top ]

$strings = array()

[line 69]

strings

associative array with all [msgid => msgstr] entries




access:  protected

Type:   array


[ Top ]



Class Methods


method factory [line 100]

object Returns factory( string $format, [string $file = ''])

Factory



return:  File_Gettext_PO or File_Gettext_MO on success or PEAR_Error on failure.
access:  public
static:  


Parameters:

string   $format   MO or PO
string   $file   path to GNU gettext file

[ Top ]

method fromArray [line 244]

bool fromArray( array $array)

fromArray

Assigns meta info and strings from an array of a structure like that:

  1. array(
  2. 'meta' => array(
  3. 'Content-Type' => 'text/plain; charset=iso-8859-1',
  4. 'Last-Translator' => 'Michael Wallner <mike@iworks.at>',
  5. 'PO-Revision-Date' => date('Y-m-d H:iO'),
  6. 'Language-Team' => 'German <mail@example.com>',
  7. ),
  8. 'strings' => array(
  9. 'All rights reserved' => 'Alle Rechte vorbehalten',
  10. 'Welcome' => 'Willkommen',
  11. // ...
  12. )
  13. )




access:  protected
see:  TGettext::toArray()


Parameters:

array   $array  

[ Top ]

method meta2array [line 178]

array meta2array( string $meta)

meta2array



access:  public
static:  


Parameters:

string   $meta  

[ Top ]

method poFile2moFile [line 125]

mixed poFile2moFile( string $pofile, string $mofile)

poFile2moFile

That's a simple fake of the 'msgfmt' console command. It reads the contents of a GNU PO file and saves them to a GNU MO file.




return:  Returns true on success or PEAR_Error on failure.
access:  public
static:  


Parameters:

string   $pofile   path to GNU PO file
string   $mofile   path to GNU MO file

[ Top ]

method prepare [line 156]

string prepare( string $string, [bool $reverse = false])

prepare



access:  protected
static:  


Parameters:

string   $string  
bool   $reverse  

[ Top ]

method toArray [line 214]

array toArray( )

toArray

Returns meta info and strings as an array of a structure like that:

  1. array(
  2. 'meta' => array(
  3. 'Content-Type' => 'text/plain; charset=iso-8859-1',
  4. 'Last-Translator' => 'Michael Wallner <mike@iworks.at>',
  5. 'PO-Revision-Date' => '2004-07-21 17:03+0200',
  6. 'Language-Team' => 'German <mail@example.com>',
  7. ),
  8. 'strings' => array(
  9. 'All rights reserved' => 'Alle Rechte vorbehalten',
  10. 'Welcome' => 'Willkommen',
  11. // ...
  12. )
  13. )




access:  protected
see:  TGettext::fromArray()


[ Top ]

method toMO [line 265]

object File_Gettext_MO toMO( )

toMO



access:  protected


[ Top ]

method toPO [line 279]

object File_Gettext_PO toPO( )

toPO



access:  protected


[ Top ]


© 2004-2005 PRADO Software Group. All Rights Reserved.