How to change the language of inserted or updated paths to LANGUAGE_NONE using a module? All path aliases are entered by hand. I need them to be language independent. Currently they are created/updated in the language that the user is currently using which does not make sense in case of my site.

I tried using hook_path_insert and hook_path_update but they only receive the $path by value and not by reference and changing the function to hook_path_update(&amp;$path) results in an error.

How to change the language of inserted or updated paths to LANGUAGE_NONE using a module? Alternatively, how can I force all aliases to be language independent automatically when user enters them? I don't think it is not possible; it is possible to allow them to choose the "All" language, but not force it.
If someone needs to have a multi language site, but have all URL aliases language independent (i.e. the same for all nodes and languages), the solution is to create a function:

mymodule_node_validate($node, $form, &amp;$form_state) { 
   $form_state['values']['language'] = LANGUAGE_NONE; 
}


As a side effect, it also makes all nodes language independent. One possible scenario where this would be useful is:


all nodes are created in a custom language which is also the site default language
the administration interface is in English (this so far requires multi-language)
the administrator users are able to use the same URL aliases as the rest of site visitors, despite the fact that they have English set while the content is in a different language (this requires the trick)


In a real multi-language scenario, URL aliases may need to be different for different languages.