Databases: Internationalization and Localization
Mariano Iglesias (contact me)
This package can retrieve texts for internationalized applications from databases or plain text files (XML or INIs).
It provides a base data source class that defines an interface with functions to retrieve texts given their element identifiers, the language to use, the locale for a language (optional), the application section and an eventual container object of a class that is used to retrive the actual internationalized texts.
The base class interface also provides a function to retrieve the list of supported languages, and locales.
The package comes with implementation classes that know how to access the data source container objects to retrieve the texts, supported languages and locales.
Currently there are implementation classes that can retrieve the information from either databases or plain text files (in the form of XML or INI files.) Other implementation classes can be developed to retrieve the information from other data sources, such as LDAP repositories.
Click here for detailed information about this class on phpclasses.org
Example
An example script that uses a database connection as a string source.
Class
Class that extends and implements methods in DatabaseConnectionManager and is used by the database.php example script.
Class
This is an abstract class that provides the skeleton for the implementation of the class that will provide database connectivity to I18N.
Class
Implementation of DataSource, that provides the database based approach to obtain elements.
Class
Abstract class that all data sources should implement.
Doc.
Documentation that tells how to install this script, and provides a description of how to use this package.
Class
The XML parser used to parse the configuration file when using text source. It will use the DOM XML package (it is PHP5 compatible), or if it is not available, it will use PEAR's XML_Parser.
Data
SQL script to insert some example data in the database.
Example
This class presents an example of using the I18N package with text files as its source of data.
Class
Implementation of DataSource, that provides the file based approach to obtain elements.
Data
The XML configuration file used by the xml.php example script. You need to adjust paths to use it.
Class
The main I18N class that handles internationalization and localization.
Data
SQL script to create tables for using a database as a source for the I18N package.
Data
The XML configuration file used by the file.php example script. You need to adjust paths to use it.
Data
Example language file for the file.php example script.
Data
Example language file for the xml.php example script
Data
Example language file (localized) for the file.php example script.
Data
Example language file (localized) for the xml.php example script
Data
Example language file for the file.php example script.
Data
Example language file for the xml.php example script
Example
This script presents an example of using the I18N package with XML files as its source of data