By default url alias created manually or by Pathauto works only for the language of the node.
But you could make it work for all languages ina few simple steps:
- go to the page "admin/config/search/path",
- find required url alias and click "edit"
- select "All languages" in "Language" field and save
That's all, now this url alias will be active despite of what language has the user.
If manual change is not an option, you can:
Module forces url aliases to be language neutral, it works both for pathtauto and manual path aliases:
<?php
/**
* Implements hook_path_insert().
*/
function MYMODULE_path_insert($path) {
_MYMODULE_path_language_fix($path['pid']);
}
/**
* Implements hook_path_update().
*/
function MYMODULE_path_update($path) {
_MYMODULE_path_language_fix($path['pid']);
}
/**
* Fixing a given path id.
*/
function _MYMODULE_path_language_fix($pid) {
db_update('url_alias')
->fields(array('language' => LANGUAGE_NONE))
->condition('pid', $pid)
->execute();
}
?>
If you already have lot of existing content with not correct languhae for aliases, then run this code
<?php
function _neutral_paths_set_all_to_neutral($type) {
$num_updated = db_update('url_alias')
->fields(array('language' => LANGUAGE_NONE))
->condition('language', LANGUAGE_NONE, '!=')
->condition('source', $type . '/%', 'LIKE')
->execute();
if ($num_updated > 0) {
drupal_set_message(t('@num aliases were reset to language neutral', array('@num' => $num_updated)));
}
else {
drupal_set_message(t('No aliases were updated.') . $type);
}
}
_neutral_paths_set_all_to_neutral('node');
?>