phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Class: POFile

Source Location: /qp_inc/locales/_pofile.class.php

Class POFile

Class Overview

A quick and dirty class for PO/POT files

Located in /qp_inc/locales/_pofile.class.php [line 29]



		
		
		
		

Properties

Methods

[ Top ]
Descendants
Child Class Description
POTFile A class build upon class POFile to provide specific POT actions (write)

[ Top ]
Property Summary
mixed   $msgids  

[ Top ]
Method Summary
POFile   POFile()   dummy docblock makes error-free autodocs
void   addmsgid()   Add a MSGID for a specific source file
string   quote()   Quote a msgid/msgstr, preferrable with single quotes.
array   read()   Read a .po file
void   translate()   Translate msgid
true|string   write_evo_trans()   Write POFile::$msgids into $file_path.

[ Top ]
Properties
mixed   $msgids = array() [line 31]

[ Top ]
Methods
Constructor POFile  [line 36]

  POFile POFile( [ $filename = null]  )

dummy docblock makes error-free autodocs

Parameters:
   $filename: 


[ Top ]
addmsgid  [line 44]

  void addmsgid( $msgid, [ $sourcefile = ''], [ $trans = '']  )

Add a MSGID for a specific source file

Parameters:
   $msgid: 
   $sourcefile: 
   $trans: 


[ Top ]
quote  [line 276]

  string quote( string $s  )

Quote a msgid/msgstr, preferrable with single quotes.

Single quotes are preferred, as PHP just handles them as strings and does no extra parsing. Double quotes are used, if there's \n, \r or \t in the string.

Parameters:
string   $s: 

API Tags:
Return:  Quoted string (either using double or single quotes (preferred))


[ Top ]
read  [line 114]

  array read( [boolean $log_source_info = true]  )

Read a .po file

Parameters:
boolean   $log_source_info:  Log source info to $Messages?

API Tags:
Return:  with msgids => array( 'trans' => msgstr )


[ Top ]
translate  [line 72]

  void translate( string $msgid  )

Translate msgid

Parameters:
string   $msgid:  MSGID


[ Top ]
write_evo_trans  [line 220]

  true|string write_evo_trans( $file_path, $locale  )

Write POFile::$msgids into $file_path.

Parameters:
   $file_path: 
   $locale: 

API Tags:
Return:  True on success, string with error on failure


[ Top ]