This project is not covered by Drupal’s security advisory policy.
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:
<?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
<?php
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
Project information
- Unsupported
Not supported (i.e. abandoned), and no longer being developed. Learn more about dealing with unsupported (abandoned) projects - No further development
No longer developed by its maintainers. - Module categories: Multilingual
- Created by gielfeldt on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.