Closed (outdated)
Project:
Select translation
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2009 at 16:57 UTC
Updated:
25 Jan 2022 at 08:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
burgs commentedOk, here is a patch that solves my issue, as well as a tiny spelling mistake.
Comment #2
Alice Heaton commentedIf a node has not been translated at all, how can it show the English version ???
The reason it always adds the 'original' version in the list, is because that is the only version that is guaranteed to exist. So if none of your alternatives are available, it will display it in the original version.
The only other option would be to not display articles that aren't available as one of the selected languages. Is this what you are after ?
Comment #3
burgs commentedYeah, but the patch makes it so that you can type 'original' into the textbox if you want to fall back on it, but you are not forced to fall back on it.
The original "is the only version that is guaranteed to exist" but i personally think that this doesn't matter. If the translations in the list don't exist, then show nothing for that particular node.
People can still add original into the textbox if they want. Is that cool?
Comment #4
Alice Heaton commentedOk, I think you are right. Users should have the option to not return articles if they are not in one of the selected languages.
A couple of things though :
1. Your patch breaks backwards compatibility (in particular with some of my own sites!!!). I would suggest having a tick box (selected by default) that says something like "return in original language if not found".
2. For consistency across the module's features, the function select_translation_of_node in select_translation.module should be adapted in the same way (ie. have an optional argument, true by default, to return the original if languages are not found. I guess it would be ok for it to return NULL if nothing is found).
Thanks for your input to this module :)
Comment #5
hs@henrikstrindberg.se commentedHi Anselm!
Thank you for a very useful module! Your idea is brilliant!
The other behavior - to not show a node if not translated to the chosen language - is possible already by using the filter Node Translation.
All best / Henrik Strindberg
Comment #6
krlucas commentedAttached is a patch along the lines of what Anselm is describing. For backwards compatibility there is now an option/checkbox to fallback to original language when language priorities have been listed/specified. By default the option is true.
Comment #7
ao2 commentedIf there is still interest in this patch please consider sending an updated version for the drupal 8 version of the module.
Thanks,
Antonio
Comment #8
anybodyPlease reroll against latest 2.x branch.
Comment #9
anybodyNo real activity since 2012. Closing as outdated.