If you have a website thats default language is english, and someone creates a node in dutch (nl) and no one has translated it at all, some one surfing the site in spanish (es) will see the node in dutch. I can understand them seeing it in English, because that is the default language.

Can we change the "Language priorities" textbox to only default back to original if we type it in there please?

Comments

burgs’s picture

Status: Active » Needs review
StatusFileSize
new1.78 KB

Ok, here is a patch that solves my issue, as well as a tiny spelling mistake.

Alice Heaton’s picture

f you have a website thats default language is english, and someone creates a node in dutch (nl) and no one has translated it at all, some one surfing the site in spanish (es) will see the node in dutch. I can understand them seeing it in English, because that is the default language.

If a node has not been translated at all, how can it show the English version ???

Can we change the "Language priorities" textbox to only default back to original if we type it in there please?

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 ?

burgs’s picture

Yeah, 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?

Alice Heaton’s picture

Ok, 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 :)

hs@henrikstrindberg.se’s picture

Hi 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

krlucas’s picture

Attached 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.

ao2’s picture

Title: All options default to 'original' language » Make 'original' language fallback optional
Version: 6.x-0.x-dev » 8.x-1.x-dev
Issue summary: View changes
Status: Needs review » Needs work

If there is still interest in this patch please consider sending an updated version for the drupal 8 version of the module.

Thanks,
Antonio

anybody’s picture

Version: 8.x-1.x-dev » 2.x-dev

Please reroll against latest 2.x branch.

anybody’s picture

Status: Needs work » Closed (outdated)

No real activity since 2012. Closing as outdated.