Posted by gielfeldt on March 20, 2011 at 9:13am
This module handles contexts for locale. It requires the custom-locale core patch, which is bundled (for Drupal 6.20) with this module.
Under /admin/settings/language/contexts the available and default contexts are managed.
"Available contexts" are the contexts available to the system.
"Default contexts" are the default contexts for the site, FILO fallback.
The translation integrates into Drupals core Locale module.
Dependencies
- Locale
Usage
To use, add to settings.php:
function custom_locale($string = NULL, $langcode = NULL, $reset = FALSE, $options = array()) {
if (module_exists('locale_context')) {
return locale_context($string, $langcode, $reset, $options);
}
elseif (function_exists('locale')) {
return locale($string, $langcode, $reset, $options);
}
return $string;
}Developer
Also the use of hook_locale() is extended with $op = 'contexts'. Modules can now provide contexts for translation and use these
function mymodule_locale($op = 'groups') {
switch ($op) {
case 'contexts':
return array('mymodule' => 'My Module');
}
}
...
function mymodule_some_function() {
$a = t('This is my translation in module context', array(), NULL, array('context' => 'mymodule'));
}Credits
This module was sponsored by Berlingske Media A/S
Downloads
Recommended releases
Development releases
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Multilingual
- Reported installs: 2 sites currently report using this module. View usage statistics.
- Downloads: 245
- Last modified: May 14, 2012

