Say, I create "en" (english) content in node 123. Later I translate the body entity, in node 123, into "ru" (russian). I will have two translations under the same node, 123. Node 123 is then aliased to "content/somefancyname".
in mysql, my_alias table looks like this
pid | source | alias | language
-----------------------------
254 | node/123 | content/somefancyname | en
To select a language, I use a URL prefix, "en" or "ru", i.e. ru.example.com/content/somefancyname
for Russian content.
The problem is that when I go toru.example.com/content/somefancyname
, Drupal runs SELECT source FROM url_alias WHERE alias = 'content/somefancyname' AND language = 'ru'
(see /includes/path.inc, drupal_lookup_path()). It can't find the aliased URI, because it's searching for 'ru' language, when in reality, the node is under 'en' language, with a 'ru' translation.
...To wrap this up, alias paths of translated content, i.e. ru.example.com/alias123, de.example.com/alias123, es.example.com/alias123... all return page not found. In the same way, links with language prefixes do not convert into their alias ru.example/node/123 into ru.example/content/somefancyname.
Comments
Comment #1
timofey CreditAttribution: timofey commentedThis might be a Drupal core issue. I've asked here http://drupal.org/node/1294946#comment-5413402
Comment #2
plachThis is the core behavior: if an alias has a language it won't be valid in a different language. You need a 'ru' alias.
Comment #3
Kristen PolI created a sandbox module that handles this:
http://drupal.org/sandbox/kepol/1853646
Comment #4
colan@plach: Can we merge Kristen's work into ET? She's already got it set up to be optional in the ET config so users can decide if they'd like to enable the functionality or not.
I'd be happy to write a patch if this is something that can eventually be committed.
Comment #5
plachWhat's wrong with having a separate module? If I a not mistaken the current code deals only with nodes, if such a feature were to be included in ET people would expect it to work with any entity type. And bug reports/feature requests would be submitted. Honestly I don't have the resources to maintain so much code I didn't write nor I know well, sorry.
Comment #6
colanFair enough. I just thought it would be nice to have fewer modules required to set up multi-lingual D7 sites, not more.
I created an issue in the sandbox queue requesting that it be turned into a formal project: #2201559: Promote sandbox to full project.