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

Class: MessageSource_SQLite

Source Location: /I18N/core/MessageSource_SQLite.php

Class Overview

MessageSource
   |
   --MessageSource_SQLite

MessageSource_SQLite class.

Class Details

[line 41]
MessageSource_SQLite class.

Retrive the message translation from a SQLite database.

See the MessageSource::factory() method to instantiate this class.




version:  v1.0, last update on Fri Dec 24 16:58:58 EST 2004
author:  Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>


[ Top ]

Variables

Methods


Inherited Variables

Inherited Methods

Class: MessageSource

MessageSource::append()
Add a untranslated message to the source. Need to call save() to save the messages to source.
MessageSource::factory()
Factory method to instantiate a new MessageSource depending on the
MessageSource::getCache()
Get the cache handler for this source.
MessageSource::getCatalogueList()
Get all the variants of a particular catalogue.
MessageSource::getCulture()
Get the culture identifier for the source.
MessageSource::getLastModified()
Get the last modified unix-time for this particular catalogue+variant.
MessageSource::getSource()
Get the source, this could be a filename or database ID.
MessageSource::isValidSource()
Determine if the source is valid.
MessageSource::load()
Load a particular message catalogue. Use read() to to get the array of messages. The catalogue loading sequence is as follows
MessageSource::loadData()
Load the message for a particular catalogue+variant.
MessageSource::read()
Get the array of messages.
MessageSource::setCache()
Set the cache handler for caching the messages.
MessageSource::setCulture()
Set the culture for this message source.

Class Variables

$source =

[line 47]

The SQLite datasource, the filename of the database.



access:  protected

Type:   string
Overrides:   Array


[ Top ]



Class Methods


constructor __construct [line 55]

MessageSource_SQLite __construct( string $source)

Constructor.

Create a new message source using SQLite.




see:  MessageSource::factory();


Parameters:

string   $source   SQLite datasource, in PEAR's DB DSN format.

[ Top ]

method catalogues [line 336]

array catalogues( )

Returns a list of catalogue as key and all it variants as value.



return:  list of catalogues


[ Top ]

method delete [line 309]

boolean delete( string $message, [string $catalogue = 'messages'])

Delete a particular message from the specified catalogue.



return:  true if deleted, false otherwise.


Parameters:

string   $message   the source message to delete.
string   $catalogue   the catalogue to delete from.

[ Top ]

method getCatalogueList [line 143]

array getCatalogueList( string $catalogue)

Get all the variants of a particular catalogue.



return:  list of all variants for this catalogue.
access:  protected


Overrides MessageSource::getCatalogueList() (Get all the variants of a particular catalogue.)

Parameters:

string   $catalogue   catalogue name

[ Top ]

method getLastModified [line 102]

int getLastModified( string $source)

Get the last modified unix-time for this particular catalogue+variant.

We need to query the database to get the date_modified.




return:  last modified in unix-time format.
access:  protected


Overrides MessageSource::getLastModified() (Get the last modified unix-time for this particular catalogue+variant.)

Parameters:

string   $source   catalogue+variant

[ Top ]

method isValidSource [line 125]

boolean isValidSource( string $variant)

Check if a particular catalogue+variant exists in the database.



return:  true if the catalogue+variant is in the database, false otherwise.
access:  protected


Overrides MessageSource::isValidSource() (Determine if the source is valid.)

Parameters:

string   $variant   catalogue+variant

[ Top ]

method loadData [line 67]

array &loadData( string $variant)

Get an array of messages for a particular catalogue and cultural variant.



return:  translation messages.
access:  protected


Overrides MessageSource::loadData() (Load the message for a particular catalogue+variant.)

Parameters:

string   $variant   the catalogue name + variant

[ Top ]

method save [line 224]

boolean save( [string $catalogue = 'messages'])

Save the list of untranslated blocks to the translation source.

If the translation was not found, you should add those strings to the translation source via the append() method.




return:  true if saved successfuly, false otherwise.


Parameters:

string   $catalogue   the catalogue to add to

[ Top ]

method update [line 270]

boolean update( string $text, string $target, string $comments, [string $catalogue = 'messages'])

Update the translation.



return:  true if translation was updated, false otherwise.


Parameters:

string   $text   the source string.
string   $target   the new translation string.
string   $comments   comments
string   $catalogue   the catalogue of the translation.

[ Top ]


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