You can use field_language() to figure out which language to use for a
specific field. It will return an array in the form of 'field_name' =>
'language key' ('und' in your case).http://api.drupal.org/api/drupal/modules--field--field.multilingual.inc/function/field_language/7 I am however not sure where to get the necessary arguments for that function from, especially entity_type, no idea if you can get it from the views metadata. On Mon, Nov 22, 2010 at 12:47 AM, <[email protected]> wrote: > You confirm what I'd inferred from Peter's message. So...off to read and > ponder :) > > On 11/21/2010 06:45 PM, Larry Garfield wrote:Thanks. That clears up the > mystery of the term, but implies that I cannot count on 'und' being the > index. > > On 11/21/2010 06:37 PM, Peter Droogmans wrote: >> >> Und indicates unknown language >> >> Met vriendelijke groeten, >> Peter Droogmans >> 'und' indicates that the field's value does not change with the language >> of >> the site. If the field had multiple translations, then und would be >> replaced >> with the appropriate language code, such as 'en-us' or 'fr'. For that >> reason >> you don't want to hard-code 'und', and instead use the appropriate >> language >> value there instead. >> >> How you get the appropriate language value in that context... I have no >> idea. >> I actually find the data structure for Fields in D7 to be completely >> incomprehensible and virtually unusable so the fact that you managed to >> make >> it that far is a miracle. :-) >> >> --Larry Garfield >> >> On Sunday, November 21, 2010 5:20:23 pm [email protected] wrote: >> >>> >>> I will write it up. That said, I got it working this afternoon! I'm a >>> little unsure about one part though, where I pluck the field's value >>> from the value array. It seems that there should be a more elegant way >>> of walking to the correct index than this: >>> >>> >>> $values->_field_cache[$this->field_alias]['object']->{$this->definition['fi >>> eld_name']}['und'][0]['safe_value']; >>> >>> and in particular, the ['und'][0]['safe_value'] part of it. In my case, >>> it is predictable that there will only be one instance of the field in >>> the row, so the [0] is ok, otherwise I'd loop. I guess it's the ['und'] >>> that is bothering me, especially not knowing what 'und' indicates. >>> >>> On 11/21/2010 01:34 PM, Earl Miles wrote: >>> >>>> >>>> This is an interesting side effect of field API, and you're right. It >>>> will be more difficult to make what used to be simple changes. You are >>>> blazing new territory with this, and what you are doing may be an >>>> uncommon but important need for advanced Views users. Please be sure to >>>> write up what you have discovered so that we can document this and >>>> hopefully the next person to do it doesn't have to spend weeks figuring >>>> out the levels of abstraction to make deep modifications to field api >>>> fields. >>>> >
