Currently there are 2 levels of language support, normal and extended. Extended allows users to specify any defined language when submitting a node. This is very useful as a sort of staging for a language, so I can add a new language to the site and leave it disabled until we are ready to make that language "live".

The problem is that disabled language links will show up on node pages if there is a translation in one of the disabled languages. I can see that this is probably the desired functionality, but I think it would also be useful to be able to create content in a disabled language and not have that link display in the links.

This patch adds a third support level, Extended, not displayed.

CommentFileSizeAuthor
#4 i18n_6x_349193.patch5.87 KBstella
i18n.extended.patch3.88 KBzroger
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo’s picture

@Roger López

Can you explain a bit more why one wouldn't want the links displayed? What is the use case, and what are the disadvantages of displaying the link?

zroger’s picture

Use case:

I have a site with only English and Spanish enabled. I want to start adding french content, but I don't want french content displayed anywhere.

What i want is to be able to add French content while it is in the disabled state, but only display french content once the French language has been disabled. I understand that the french content being created can be set as unpublished. It just seems like an odd thing to have a disabled language show up anywhere on the site.

Personally I think this is a more likely use case than to have a disabled language show up occassionally.

Hope that helps.

Jose Reyero’s picture

Status: Needs review » Needs work

Yes, I understand your use case -which is not the same as the one we built the feature around- but also makes sense.

The patch looks good but misses a few things: Drupal core actually adds links for all node translations (whatever the language's status is) so what we need to do is to remove the links for the LANGUAGE_SUPPORT_EXTENDED_NOT_DISPLAYED case. It would be great if we could combine it with this one, as it is quite similar (removing some node language links), #242408: Remove language links from nodes and use language switcher block only

An easy workaround for your case is to create unpublished nodes so only administrators see them.

stella’s picture

Status: Needs work » Needs review
FileSize
5.87 KB

The attached patch extends on the original one and takes Jose's comments in #3 into account. I've also merged in the patch from #242408: Remove language links from nodes and use language switcher block only as suggested as they're quite similar.

Cheers,
Stella

catch’s picture

Tested #4. Everything seems to work well. The patch actually hides links in the core cases too where a language is disabled - which seems sensible to me but I'd be interested to know whether all links being shown was done for a reason. Otherwise it all looks RTBC to me.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Thinking about the 'normal' case more, it seems like a bug that those links are shown while the language isn't enabled, so marking RTBC.

zroger’s picture

Tested the new patch and it works as advertised. RTBC from me too.

nedjo’s picture

Issue tags: +i18n sprint
Jose Reyero’s picture

Status: Reviewed & tested by the community » Fixed

Great work, thanks, committed

Status: Fixed » Closed (fixed)
Issue tags: -i18n sprint

Automatically closed -- issue fixed for two weeks with no activity.