When I create multilingual content I make a page in several languages and those could be node/3 (in English) and node/4 (in Dutch). Then I alias them with "path" as en/page-name and nl/page-name.

If I go to node/3 globalredirect will send me to the correct page. When I go to en/node/3 globalredirect chokes. My patch uses the i18n functions to redirect correctly if all else fails.

Also trim() is quite a bit faster than preg_replace().

CommentFileSizeAuthor
globalredirect_0.patch833 bytesjax

Comments

nicholasthompson’s picture

Status: Active » Closed (duplicate)

Jax - thanks for this patch! VERY useful!! I was scratching my head on how to fix this...

Also thanks for the trim tip! I did NOT know that trim had a second argument!

However, this is a duplicate of #153950... So I'll mark this as duplicate but reference this post in the other issue...