Needs work
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Jul 2011 at 15:35 UTC
Updated:
9 Dec 2021 at 17:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mavimo commentedPatch into attachment
Comment #2
dawehnerAs you can see in #1181744: Figure out what to do update duplicate locale/language handlers there is the same handler used twice.
Perhaps first the other issue should be fixed
Comment #3
tim.plunkettTriggering the testbot.
Comment #5
dawehnerJust an easy reroll.
Comment #6
tim.plunkettWhy not move this inside the conditional?
Maybe add a comment here?
Comment #7
mavimo commentedAdd @tim.plunkett suggestion
Comment #9
mavimo commentedRe-rolled patch
Comment #10
dawehnerSo what are we doing with #594632: double file views_handler_argument_node_language.inc ?
Comment #11
dawehnerWe should add this feature to field_locale_language as well
let's name it langcode
I think the proper noun for this is "langcode".
If we return the langcode directly we should maybe sanitize the value.
Comment #12
mavimo commentedPatch update, with some approach change.
Into Edit language interface ( http://YOURSITE/admin/config/regional/language/edit/en ) we can see three different type of "Language display" as:
We change the class views_handler_field_locale_language and views_handler_field_node_language to reflect this options, so user can choose from this three different options.
I think we can create a new class (views_handler_field_language) that implement this change and, to remove duplicate code, change:
Let me know what do you think about this change.
Comment #13
dawehnerWhen you rename options, you should at least take care that the options are converted in the init method unless you want to break existing sites :)
Comment #14
mavimo commented@dawehner Done
Comment #15
lolandese commentedParticularly nice that an empty language field results in the code 'und'.
Needed this functionality to create e CSV export file with the "Content: Language" field. To validate when mapped with an importer using the Feeds module. For anyone having the same particular problem and tied to the use of the stable version of Views, have a look at http://drupal.org/node/1819720, using the Feeds Tamper module.
Comment #16
mxtI need this feature too: for now I have to use this workaround:
Hope this patch will be committed soon
Comment #17
skyredwangalso tested, and the #14 patch works!
Comment #18
playfulwolf commentedapplied the patch, but do not understand what it supposed to do?
Comment #19
yang_yi_cn commentedit provides an option in the views field to allow display language in formats other than the human readable name (machine code, for example).
I'm using it but there are some bugs when you try to edit an existing view, as the existing view don't have that variable saved so it throw an invalid index PHP error.
Also I experienced AJAX/PHP error when you try to use it on a non-Node view. It's because in file views_handler_field_locale_language you cannot render_link(). That is a function for node handler only, you can only return the text value.
I'm attaching the updated patch here (rolled against Views-7.x-3.7
Comment #20
yang_yi_cn commentedI'm attaching the updated patch here (rolled against Views-7.x-3.7
Comment #22
dagmarRe-rolled using git
Comment #23
dagmarComment #24
graker commentedThe patch from #22 works for me. The only thing I had to do is to delete the Language field from my view and then to add it again so the field display option becomes available.
Thanks!
Comment #25
skyredwangComment #26
abelassHi,
is this currently implemented in a stable version?
I am using 7.x-3.7 and can't find this option. How can I obtain the language code?
Thanks
Rainer
Comment #27
damienmckennaComment #32
shaxa commentedPatch is not working correctly since it always unsets the new option if you are applying it for the first time and you have the native option set. I am applying a new working patch.
Comment #33
shaxa commentedComment #34
asiby commentedI gave it another try. The following patch show work. I have also successfully did the same thing using hooks. That can be useful if you (just like myself) badly need this patch before it is approved and merged.
Comment #35
asiby commentedComment #36
asiby commentedComment #37
asiby commentedSorry guys. I got confused by the way the reply IDs are provided and the timing of how I should number my patch. Here is the same patch again... but this time, with the number 37.
Comment #38
zalak.addweb commentedComment #39
nitesh sethia commentedUpdating the patch with some commenting.
Comment #40
damienmckennaAm concerned that changing the form fields would break existing Views definitions, so adding an update script or allowing it to also support the previous value might be a good idea.
Comment #41
jenlamptonFor those who need langcode in a view, see https://www.drupal.org/project/views_language.