When viewing a node, we should only display links to translations of that node from the same country - this will prevent showing more than one translation in the same base language.

CommentFileSizeAuthor
#2 hook_link_alter.patch1.21 KBcatch
hook_link_alter.patch943 bytescatch

Comments

catch’s picture

Updated with some code comments, and now removes two digit languages not supported by the current user's country.

catch’s picture

StatusFileSize
new1.21 KB
nedjo’s picture

Status: Fixed » Active

It's not working as expected for me and also I realized we need to change the behaviour.

Some sites aren't going to want these links at all. We have a language switcher, that's enough in many cases.

If the links are retained, we need to reset the string shown for languages. Users should never see "English (Canada)" even if it's a link to the en-CA version. They should just see "English".

Expected behaviour:

When viewing a node, a user sees only translations that are valid for the current country, with country-specific languages taking priority of their generic equivalents.

I'm thinking we shd unset the existing array and recreate it, rather than doing such complex altering.

catch’s picture

Status: Active » Needs work

For now, I've added a setting to disable translation links altogether on the configuration tab. Looks like we might need three options:

1. retain core's behaviour
2. remove links altogether
3. Show only translations that are valid for the current country

However I'm going to move on to some of the more critical issues first.