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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | hook_link_alter.patch | 1.21 KB | catch |
| hook_link_alter.patch | 943 bytes | catch |
Comments
Comment #1
catchUpdated with some code comments, and now removes two digit languages not supported by the current user's country.
Comment #2
catchComment #3
nedjoIt'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.
Comment #4
catchFor 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.