Language for content types without language support must be Neutral

dvinegla - May 15, 2008 - 10:33
Project:Drupal
Version:7.x-dev
Component:language system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

In you creates content type without language support, default language is assigned to it.

I think it must be '' (neutral) or FALSE

#1

desbeers - May 23, 2008 - 16:52
Version:6.2» 7.x-dev
Status:active» needs review

I completely agree. For example, the i18n module for D6 has the option to filter content and one of the filter-options is 'including neutral'.

Let's say you create a custom node-type that just contains a photo; it's language-neutral and it's silly to assign the default language to it.

I found this problem while upgrading my site form D5 to D6 and added the 'translate' function only to stories and not for pages yet. New pages didn't show-up when visiting the 'non-default' language version of my site.

Attached patch just removes the 'offending' code in function locale_form_alter() in locale.module. and the SimpleTest didn't complain after running the tests.

AttachmentSizeStatusTest resultOperations
neutral.patch859 bytesIdleFailed: Failed to apply patch.View details | Re-test

#2

bensemmel - May 24, 2008 - 09:20

Had the same issue. Thanks for the Patch. It is working for me as well

#3

lilou - October 26, 2008 - 13:11
Status:needs review» reviewed & tested by the community

Look good and all tests pass (thx Testbed ;-)

#4

Dries - October 26, 2008 - 17:26

I'd like to have Gabor review this.

#5

Gábor Hojtsy - October 26, 2008 - 18:07
Status:reviewed & tested by the community» needs work

I think that there are more levels here. While for photos, this looks like a valid use case, you might have other areas where this does not apply. For example, you have a single foreign language blog (let's say French), there you would not enable language selection for blog posts, since you only have one language. But your blog posts are definitely not language neutral, they are French. So there might be two options to not add language selection to a content type: to assign default language or to assign language neutral. This could be another possibility in the locale module provided settings additionally to what we have on content types already.

If you language-enable a content type, it means you can select from at least Language neutral and a specific language, so it is not a one-op thing as you assert.

#6

thePanz - October 29, 2008 - 10:26

I'm with Gàbor! A setting for default-language is needed: none (or language neutral) or Default (default site language)

I know that this feature won't be added into D6, but will be useful to have some module that implenent this (and maybe also http://drupal.org/project/preserve_language features).

Regards

#7

Anselm Heaton - October 31, 2008 - 10:05

Following a request from thePanz, the Preserve Language module now implements this fix for Drupal 6. The code was contributed to the module by thePanz.

I've only just committed it to CVS - so package might take up to 12 hours to be ready.

#8

drewish - November 24, 2008 - 12:22

i think goba's got the right idea here. but i think that even the photo example is a little too simplistic. photos usually have a caption or title and that's going to have a language.

i've usually had to form alter the language selector to remove language neutral out of certain node types because they always have a language. but i'm using the active translation module to handle the selection of content for languages so my needs may be different than most.

#9

David Lesieur - November 30, 2008 - 22:13

I'd love an option as proposed by Gábor in #5. Furthermore, I think that for language-enabled content types, admins should be able to remove the "language neutral" option.

On a particular project, I wish to avoid language neutral content, and show the original nodes to visitors when a translation is not available in their language. To avoid a "duplicate content penalty", I want all nodes to have a language in order to be able to instruct robots not to index a node when the current language is not the actual language of that node—something we can't do if nodes are "language neutral".

So far my plan to achieve this involves:

  1. Using Active Translation to select the proper nodes in general queries.
  2. Using Select Translation to select the proper nodes in views.
  3. Using hook_form_alter to remove the "language neutral" option from forms and force writers to select a language.
  4. When viewing a node, add the noindex meta tag if the node's language does not match the current language.

Hopefully, this discussion might help solve step 3 in D7.

#10

dvinegla - February 14, 2009 - 23:28

#11

Pasqualle - May 17, 2009 - 22:48

same alias problem here: #311158: default node language

I almost agree with Gábor, but the language of non-multilingual nodes should be configurable per node type. I may want a node type which is not multilingual, not language neutral and not written in default language.

But there is still a question what should be the alias language? Let's say node/5 is not a multilingual node and it has an alias. If I use url('node/5') then the alias should be used regardless of the active language and the node language.. So I guess alias language for non-multilingual nodes should be language neutral..

And as far as I know if the locale module is not enabled then all nodes are language neutral. So it is problematic when creating some nodes and enabling the locale module later.. Maybe a bulk update checkbox when changing the language of non-multilingual node types..

#12

marcushenningsen - August 18, 2009 - 21:38

Maybe a bulk update checkbox when changing the language of non-multilingual node types..

This would be a great feature. It's very tedious to go through each alias to change it into "neutral language". If you can bulk promote to frontpage it should be possible to bulk change language.

#13

voxpelli - October 21, 2009 - 22:12
Status:needs work» needs review

This needs to be fixed since the current behavior is very inconsistent.

Language neutral is default when locale.module isn't activated and also when it is activated and the multilingual support is enabled. The default all of the sudden is the site's default language though when locale.module is active and the multilingual support is disabled - which is currently the only time it's the default language for a node.

I think that the default behavior should always be neutral unless you actively choose otherwise - it would result in the most consistent behavior. I don't think the expected behavior for a new user of locale.module is to have all of their new content to become the default language - it's just confusing.

I'm attaching a patch that makes it configurable for each content type whether to default to neutral or to the site's default language. I've made neutral the default in the patch for the reasons I mentioned above.

AttachmentSizeStatusTest resultOperations
neutral_language_content_default_issue_258785.patch2.52 KBIdleFailed: 14406 passes, 7 fails, 2 exceptionsView details | Re-test

#14

voxpelli - October 21, 2009 - 22:13
Category:bug report» feature request

Also - I think this should be a feature request and not a bug report, no matter how annoying the current behavior might be...

#15

System Message - October 21, 2009 - 22:35
Status:needs review» needs work

The last submitted patch failed testing.

#16

plach - November 5, 2009 - 13:37

subscribe

#17

donquixote - November 16, 2009 - 09:05

Agree with voxpelli.
I would love to see a module to fix this for D6.. or actually, I would love this to get fixed in the D6 locale module itself.
I'm not sure if the "Preserve Language" module is mature enough? I think for now I will code my own.

#18

donquixote - November 16, 2009 - 10:39

Anyone who needs a fix now can use the attached module.

AttachmentSizeStatusTest resultOperations
content_language_neutral.zip825 bytesIgnoredNoneNone
 
 

Drupal is a registered trademark of Dries Buytaert.