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

Class: File_Gettext

Source Location: /File_Gettext-0.4.2/File/Gettext.php

Class Overview


File_Gettext


Author(s):

Copyright:

  • 2004-2005 Michael Wallner

Variables

Methods


Child classes:

File_Gettext_PO
File_Gettext_PO
File_Gettext_MO
File_Gettext_MO

Inherited Variables

Inherited Methods


Class Details

[line 39]
File_Gettext

GNU gettext file reader and writer.

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

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



[ Top ]


Class Variables

$file =  ''

[line 68]

file path
  • Access: protected

Type:   string


[ Top ]

$meta = array()

[line 60]

meta

associative array containing meta information like project name or content type

  • Access: protected

Type:   array


[ Top ]

$strings = array()

[line 49]

strings

associative array with all [msgid => msgstr] entries

  • Access: protected

Type:   array


[ Top ]



Method Detail

factory   [line 81]

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

Parameters:

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

[ Top ]

fromArray   [line 226]

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.    )


Parameters:

array   $array     Array to populate from.

[ Top ]

meta2array   [line 159]

array meta2array( string $meta)

meta2array
  • Access: public

Parameters:

string   $meta     Meta data to turn into an array

[ Top ]

poFile2moFile   [line 105]

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

Parameters:

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

[ Top ]

prepare   [line 137]

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

prepare
  • Access: protected

Parameters:

string   $string     String to prepare
bool   $reverse     Reverse ?

[ Top ]

raiseError   [line 279]

object raiseError( [string $error = null], [int $code = null])

Raise PEAR error
  • Access: protected

Parameters:

string   $error     Error message
int   $code     Error constant

[ Top ]

toArray   [line 195]

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.    )


[ Top ]

toMO   [line 247]

object File_Gettext_MO &toMO( )

toMO
  • Access: protected

[ Top ]

toPO   [line 261]

object File_Gettext_PO &toPO( )

toPO
  • Access: protected

[ Top ]


Documentation generated on Sun, 04 Mar 2012 04:30:02 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.