Context translation
Context settings

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

Version Downloads Date Links
6.x-1.2 tar.gz (12.42 KB) | zip (14.75 KB) 2011-Jun-08 Notes

Development releases

Version Downloads Date Links
6.x-1.x-dev tar.gz (12.43 KB) | zip (14.76 KB) 2011-Jun-08 Notes

Project Information


Maintainers for Locale Context

  • gielfeldt - 19 commits
    last: 50 weeks ago, first: 1 year ago

Issues for Locale Context

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
nobody click here