I am using language selection by language domain in Drupal 7. That has the side effect, that all internal Drupal pathes being created as absolute pathes by the i18n module.
To get subdomains working again I want to alter the pathes that are translated by i18n. Is there a hook I could use for that?
The function hook_url_outbound_alter() is triggered before the path translation by i18n, so it can't be used for that purpose.

Comments

drclaw’s picture

You could try hook_translated_menu_link_alter(). Here's an example:

/**
 * Implements hook_translated_menu_link_alter()
 *
 * Translate menu link paths if a menu path translation exists
 */
function HOOK_translated_menu_link_alter(&$item, $map) {
  if (module_exists('i18n_path')) {
    if (custom_function_is_absolute($item['href'])) {
      $item['href'] = custom_function_make_relative($item['href']);
    }
  }
}
drclaw’s picture

Although I guess that's only good it it's a menu link...

jose reyero’s picture

Status: Active » Closed (works as designed)

I don't think it's i18n as all these links are produced by Drupal core now. And anyway, if you use different domains for languages that's just how it's suppossed to work.