PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Internationalization » Translation2

Class for multilingual applications management.

This package is unmaintained.

Download latest release 2.0.4 (archived versions might be outdated)

License: BSD

Description

This class provides an easy way to retrieve all the strings for a multilingual site from a data source (i.e. db).
The following containers are provided, more will follow:
- PEAR::DB
- PEAR::MDB
- PEAR::MDB2
- gettext
- XML
- PEAR::DB_DataObject (experimental)
It is designed to reduce the number of queries to the db, caching the results when possible.
An Admin class is provided to easily manage translations (add/remove a language, add/remove a string).
Currently, the following decorators are provided:
- CacheLiteFunction (for file-based caching)
- CacheMemory (for memory-based caching)
- DefaultText (to replace empty strings with their keys)
- ErrorText (to replace empty strings with a custom error text)
- Iconv (to switch from/to different encodings)
- Lang (resort to fallback languages for empty strings)
- SpecialChars (replace html entities with their hex codes)
- UTF-8 (to convert UTF-8 strings to ISO-8859-1)

Documentation

Manual

Maintainers

Dependencies

Required

Optional

Releases

Bugs

IDStatusTypeVersionDateSummary
#1769ClosedBug2004-07-02Typo in example
#1825ClosedReq2004-07-08no table prefix delivered to class?
#2153ClosedBug2004-08-17Translation2_Admin_Container_db can't alter table, only create new ones
#2248ClosedBug2004-08-29Translation2 Missing Language Index
#2256ClosedReq2004-08-30Cache flushing/write update
#2437BogusBug2004-10-02createNewLang Admin Container SQL
#2498ClosedBug2004-10-11Translation2::setLang() misses errorhandling
#2503ClosedBug2004-10-11[PATCH] Gettext container is broken
#2508ClosedReq2004-10-11Cant change options after calling Translation2::factory()
#2543ClosedBug2004-10-15[PATCH] DB Admin container uses non-portable 'SHOW TABLES'
#2546ClosedBug2004-10-16[PATCH] DB Admin container uses non-portable CREATE ... KEY / UNIQUE KEY syntax
#2563ClosedReq2004-10-18[PATCH] Admin_DB add/update cleanup
#2564ClosedBug2004-10-18[PATCH] Admin DB update() doesn't work with single table
#2570ClosedReq2004-10-19Missing Admin::update()
#2619Wont fixReq2004-10-26Falling back to language code if fully qualified locale is not available
#2624ClosedReq2004-10-26XML Container
#2629ClosedBug2004-10-27Translation2_Admin::removeLang() does nothing (with db container)
#2631ClosedBug2004-10-27Translation2_Admin::add() produces duplicates
#2665DuplicateReq2004-11-01Translation2_Admin is not DB protable
#2667ClosedReq2004-11-01method to fetch all page ids
#2711ClosedBug2004-11-07CVS' Translation2_example.sql fails
#2844ClosedReq2004-11-28Documentation bug in createNewLang() of admin class
#2890ClosedBug2004-12-04getLang() notices if setLang() is not falled before
#2891ClosedBug2004-12-04getPageNames() returns duplicate names
#2893ClosedReq2004-12-04please add a method for updating language information
#2953No FeedbackBug2004-12-12getPage when using database container throws SQL syntax error
#2972ClosedBug2004-12-15cache_lite decorator not handling param sub as expected
#3007ClosedReq2004-12-21Documentation request
#3008BogusReq2004-12-21getCharset()
#3065ClosedReq2004-12-30getRaw() missed
#3068ClosedBug2004-12-30Admin::update() buggy
#3105ClosedReq2005-01-05Using the default Lang with Admin methods
#3149ClosedBug2005-01-10XML container does not properly handle redundant strings
#3272ClosedBug2005-01-23Translation2::get() has unused parameter defaulttext
#3408ClosedBug2005-02-08XML container : empty data sets badly handled
#3420ClosedBug2005-02-09XML Container lacks shared lock
#3498ClosedBug2005-02-16XML container: several add() produce encoding junk
#3641ClosedBug2005-02-28Translation2 is not cloneable
#3914ClosedBug2005-03-22Translation2 'CacheMemory' Decorator class get() bug!
#4002ClosedBug2005-03-30fallbackLang does not work with gettext container
#4218ClosedBug2005-04-25Admin Container removeLang bug
#4227ClosedBug2005-04-26Error in the saple code
#4476ClosedBug2005-05-30GetText !_native not works without gettext extension
#5142ClosedBug2005-08-18Bug in removeLang
#5170BogusBug2005-08-21setLang will not work
#5539ClosedBug2005-09-27DefaultText decorator does not call _replaceParams
#5773ClosedReq2005-10-25Decorator - Lang - append keys when fallback lang contains more than current
#6137BogusBug2005-12-03Problem with XML container, using Translation2_Admin
#6227ClosedBug2005-12-12Typo in function _fetchTableNames()
#6233ClosedBug2005-12-12calling Translation2_Admin::add() adds tranlslation twice
#6270ClosedBug2005-12-16Latin1 returned instead of UTF-8
#6410ClosedBug2006-01-04Various fixes to gettext backend error handling
#6574ClosedBug2006-01-24Translation2_Container::raiseError does not honor global PEAR error settings
#6585BogusBug2006-01-25Admin add string
#6753ClosedBug2.0.0beta82006-02-11Missing method updateLang from Translation2_Admin_Decorator class
#7058ClosedBug2.0.0beta92006-03-08array_merge breaks bc in decorator
#7573BogusBugCVS2006-05-07Fatal error: Class 'MDB2' not found
#7576BogusBug2006-05-08Fatal error: Call to undefined method MDB2_Error::setLang()
#7736ClosedReqCVS2006-05-28Ability to specify CacheLite group for CacheLite Decorator
#7793ClosedBug2.0.0beta92006-06-02XML container not working
#8127No FeedbackBug2.0.0beta92006-07-06'0' isn't an empty string
#8128ClosedBug2.0.0beta92006-07-06getPage() does not work
#8331ClosedBug2.0.0beta102006-07-31AddLang() SQL not compatible with MSSQL
#8546ClosedBug2.0.0beta102006-08-23column/table names are not escaped in SQL queries
#8547ClosedBug2006-08-23Documentation is missing a column on "default db structure"
#8734ClosedBug2.0.0beta112006-09-19Wrong use of list()
#8915ClosedBug2006-10-09Fetching vom Database does not work with Oracle
#9239ClosedDoc2.0.0beta112006-11-05Documentation for Database Containers - encoding
#9297ClosedReq2.0.0beta112006-11-10More parameters please
#9301ClosedReq2.0.0beta112006-11-10[PATCH] Caching setLang() and setCacheOption()
#9457Wont fixReq2.0.0beta112006-11-25Direction column in database
#9855ClosedBug2.0.0beta122007-01-17missing $this->_prepare(); call
#10058ClosedBug2.0.0beta122007-02-08MDB2 Driver: createConstraint fails
#10086No FeedbackBug2.0.0beta122007-02-13Container gettext is missing a way to set default langID on the getOne method
#10087ClosedBug2.0.0beta122007-02-13i18n table creation failed and lang_avail table not created
#11482ClosedBug2.0.0beta122007-06-29Call of addLang with existing languages with MDB2 results in error
#11880ClosedBug2.0.0RC12007-08-21Removing _one_ language removes all strings for _all_ languages
#11881ClosedBug2.0.0RC12007-08-21Translation2::getLang(...,'array') returns ID as 'id' instead of 'lang_id'
#12183ClosedBug2.0.0RC12007-10-04Default language ID '0' considered to be invalid
#12396ClosedBug2.0.0RC12007-11-07Bug in Admin/Container/mdb2.php addLang
#12398ClosedBug2.0.0RC12007-11-07updateLang returns incorrect type
#12400Wont fixReq2.0.0RC12007-11-08request for new method in Admin class
#12405ClosedReq2.0.0RC12007-11-08request for new method in Admin class
#12525ClosedBug2.0.0RC22007-11-25t2xmlchk.php script has wrong baseinstalldir
#12527ClosedBug2.0.0RC22007-11-26CacheMemory doesn't properly prefetch pages
#12703ClosedBug2.0.0RC32007-12-16CacheLiteFunction decorator and getLang() issue
#13734ClosedReqCVS2008-04-21Dynamic page_id column length
#13933ClosedBug2.0.02008-05-18Translation2_Container_dataobjectsimple::getOne() - undefined variable $string
#14277ClosedBug2.0.02008-07-02Result from method getLang differs depending on cache decorator
#14282ClosedReq2.0.02008-07-02Normalize DB table scheme
#14323ClosedBug2.0.02008-07-10wrong / no error from setLang()
#14979ClosedReq2.0.02008-11-09Fluent interface for setOption()
#15000ClosedBug2.0.02008-11-12Translation table schema missing
#15975Wont fixReq2009-03-04need extra condition check to Lang decorator
#16787ClosedReq2.0.12009-11-13default 'latin1_swedish_ci' db created with collation set to utf8_unicode_ci
#18081ClosedBug2.0.32010-11-22Translation2.php installed in the wrong place