[development] Drupal and i18n, the holy grail?

Adrian Rossouw adrian at bryght.com
Sat Feb 25 14:47:08 UTC 2006

On 25 Feb 2006, at 4:30 PM, Bèr Kessels wrote:
> Care to share yuor thoughts on this Adrian?

add 2 columns to the variables table, namely 'realm' and 'id'

During system initalisation, do :
variable_init('realm', $id) , to load that realm's settings into memory.

In the example of locale, you would have :
function locale_init() {
  variable_init('locale', $GLOBALS['lang']);

What this would do, is load the settings onto the setting stack.

so when you do variable_get('my_setting', 'default') it would get the  
top most variable
for that from the stack.

This would be useful for the following cases :

user specific settings
layout/view specific settings (the successor to the sections module)
locale specific settings (this example)
install profile specific settings (install profile specified defaults)

and quite a few more.

Remember that just because you can override any setting doesn't
mean you will be able to from the interface. You still need to actually
have a form element to capture the setting for that specific layer,
although you might just change the default layer that things save to.

Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com

More information about the development mailing list