According to http://api.drupal.org/api/global/language/6, the $language global is an array, but in reality, it is an object, whose structure is taken from the languages table structure.

Comments

curtisain’s picture

And more important: how can we use that object?
Code like:

global $language;
$str.=$language['language'];

throws a "Fatal error: Cannot use object of type stdClass as array"

curtisain’s picture

Just found out:

$language->language

does the trick. Silly me!

nielsbom’s picture

Component: Developer Guide » Other documentation issues
Status: Active » Closed (fixed)

Closed the issue.

Changed the component to reflect the new component categorization. See http://drupal.org/node/301443
-nielsbom

yhager’s picture

Status: Closed (fixed) » Active

Did you intend to close the issue? The docs are still wrong, so reopening.

betz’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Other documentation issues » documentation
betz’s picture

Project: Drupal core » Documentation
Version: 7.x-dev »
Component: documentation » Other documentation issues

sorry, was wrong :)

emmajane’s picture

Project: Documentation » Drupal core
Version: » 6.0
Component: Other documentation issues » documentation

API docs; moved to core documentation.

dgorton’s picture

Priority: Normal » Minor
Status: Active » Reviewed & tested by the community

Updated and committed to D6 and D7. Marking as rtbtc as a reminder to check actual api output (http://api.drupal.org/api/global/language) before closing.

dgorton’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Done. closing.