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
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.
#2
Had the same issue. Thanks for the Patch. It is working for me as well
#3
Look good and all tests pass (thx Testbed ;-)
#4
I'd like to have Gabor review this.
#5
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
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
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
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
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:
Hopefully, this discussion might help solve step 3 in D7.
#10
related issue: #374404: Create alias only works in one language
#11
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
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
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.
#14
Also - I think this should be a feature request and not a bug report, no matter how annoying the current behavior might be...
#15
The last submitted patch failed testing.
#16
subscribe
#17
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
Anyone who needs a fix now can use the attached module.