}
/**
+ * Implementation of hook_preprocess_page().
+ *
+ * Add the language code to the classes for the <body> tag. Unfortunately, some
+ * themes will not respect the variable we're modifying to achieve this - in
+ * particular, Garland and Minelli do not.
+ */
+function i18n_preprocess_page(&$variables) {
+ if (isset($variables['body_classes'])) {
+ global $language;
+ $variables['body_classes'] .= ' i18n-' . $language->language;
+ }
+}
+
+/**
* Implementation of hook_exit().
*/
function i18n_exit() {
* Take over the taxonomy pages
*/
function i18ntaxonomy_menu_alter(&$items) {
- // Taxonomy term page. Localize terms.
- $items['taxonomy/term/%']['module'] = 'i18ntaxonomy';
- $items['taxonomy/term/%']['page callback'] = 'i18ntaxonomy_term_page';
- $items['taxonomy/term/%']['file'] = 'i18ntaxonomy.pages.inc';
+ // If ctool's page manager is active for the path skip this modules override.
+ if (variable_get('page_manager_term_view_disabled', TRUE)) {
+ // Taxonomy term page. Localize terms.
+ $items['taxonomy/term/%']['module'] = 'i18ntaxonomy';
+ $items['taxonomy/term/%']['page callback'] = 'i18ntaxonomy_term_page';
+ $items['taxonomy/term/%']['file'] = 'i18ntaxonomy.pages.inc';
+ }
// Localize autocomplete
$items['taxonomy/autocomplete']['module'] = 'i18ntaxonomy';
break;
default:
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id
- && ($node = $form['#node']) && isset($form['taxonomy']) ) {
+ && ($node = $form['#node']) && isset($form['taxonomy']) && !variable_get('taxonomy_override_selector', FALSE)) {
// Node form. Translate vocabularies.
i18ntaxonomy_node_form($form);
}