Needs review
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
node data
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2012 at 11:02 UTC
Updated:
11 May 2019 at 09:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
OnkelTem commentedComment #2
OnkelTem commented* changed accordingly rendering of local_language generic handler too
Comment #3
ygerasimov commentedThere is one inconsistency we should take care with this patch. If we create a filter of the node's language for 'und' we have option 'No language'.
So we should or rename language field output to 'No language' or change filter's label to 'Language neutral'.
Next consistency fix is if we use argument of language and override title. In case of 'und' and not available language we get "Unknown language". Lets have 'No language' or 'Language neutral' for "und" and same message as language shown if it is not available (patch from #2 proposes to have message "Undefined language (@langcode)").
Please review all handlers of locale module and if you find any other inconsistencies lest fix them at once.
Comment #4
OnkelTem commentedI vote for "Language neutral" according to Drupal core naming. ("No language" is more alike empty value of the schema's Language field which is by the way not an impossible situation in more wider sense. For example, when creating Product Commerce entities with Rules, if we don't set language, it will get "" value.)
Ok, I just missed it. I will update views_handler_argument_locale_language.inc and views_handler_argument_node_language.inc accordingly.
Comment #5
OnkelTem commentedComment #6
ygerasimov commentedI think it is much better. Thanks!
Comment #7
OnkelTem commentedComment #8
dawehnerCouldn't we do something like if ($langcode == LANGUAGE_NONE) { ...} {elsei f (isset($languages[$langcode]) {
this would so much simplify the actual code to read.
Just for reference, core is using the same string in locale.module:
Comment #9
OnkelTem commentedStill needs review.
I'd like to optimize the code by implementing a helper function which takes $languages list and $langcode and return correct $language name.
Comment #10
OnkelTem commented* Now implementing helper function
views_language_name($languages, $langcode)in views.module to unify languagenames resolution and thus reducing the code size.
* Adding an option to return really empty language name ("") for really empty $langcode (this is the case when you LEFT JOIN Entity Translation table for example).
Comment #10.0
OnkelTem commentedUpdated issue summary.
Comment #11
dawehnerIt would be great if someone 3rd could test this patch.
Comment #12
chris matthews commentedThe 6 year old patch in #10 does not apply to the latest views 7.x-3.x-dev.
Comment #13
chris matthews commentedComment #14
andrew answer commentedPatch rerolled.