Sorry, but what you are suggesting is a bad idea. Bootstrapping is meant to get the library into a working state by initializing required settings, variables, etc.
Some things bootstrappers should do:
- Add custom paths to 'include_path'
- Initialize character sets (UTF-8) and encoding directives (mb_internal_encoding)
- Initialize loggers (error or app logging)
- Initialize autoloaders
Your application should be handling your requirements at the controller layer. For example if a user visits example.com/controller/action/en-US, your controller can set the language accordingly by accessing the request object (and specified parameter) and set a user session var to display the current and subsequent pages in english.
-- Edit --
Example implementation for initializing i18n/locale settings using an intermediary class vs. passing values to bootstrap:
// Controller
$i18n = new i18n();
$i18n->setLocale($this->getRequest()->getParameter('locale'));
// Now I can make locale specific calls to validate localized data
$i18n->validateDate($this->getRequest()->getParameter('date'));
// Can also make queries for locale specific data
$results = $i18n->getDob()->query('select * from my_table');
// i18n class
class i18n
{
protected $locale;
public function setLocale($locale)
{
$this->locale = $locale;
}
public function getLocale()
{
return $this->locale;
}
// Factory method for creating a database object based on locale
public function getDbo()
{
switch ($this->getLocale()) {
case 'en-US':
return new Zend_Db::factory('Pdo_Mysql', array(
'host' => 'hostname',
'username' => 'username',
'password' => 'password',
'dbname' => 'en_us_locale'
));
case 'en-GB':
return new Zend_Db::factory('Pdo_Mysql', array(
'host' => 'hostname',
'username' => 'username',
'password' => 'password',
'dbname' => 'en_gb_locale'
));
}
}
}