diff --git a/ds.module b/ds.module
index 6da8a7d..4020c0d 100644
--- a/ds.module
+++ b/ds.module
@@ -521,6 +521,7 @@ function ds_get_layout($entity_type, $bundle, $view_mode, $fallback = TRUE) {
  *   Collection of fields.
  */
 function ds_get_fields($entity_type, $cache = TRUE) {
+  global $language;
 
   static $static_fields, $fields_cached = array();
   static $loaded = FALSE;
@@ -528,7 +529,7 @@ function ds_get_fields($entity_type, $cache = TRUE) {
   // Get fields from cache.
   if (!$loaded) {
     $loaded = TRUE;
-    if ($cache && $cached_fields = cache_get('ds_fields:' . $GLOBALS[LANGUAGE_TYPE_CONTENT]->language)) {
+    if ($cache && $cached_fields = cache_get('ds_fields:' . $language->language)) {
       $fields_cached = $static_fields = $cached_fields->data;
     }
   }
@@ -563,7 +564,7 @@ function ds_get_fields($entity_type, $cache = TRUE) {
 
       // Cache the fields.
       if ($cache) {
-        cache_set('ds_fields:' . $GLOBALS[LANGUAGE_TYPE_CONTENT]->language, $fields_cached, 'cache');
+        cache_set('ds_fields:' . $language->language, $fields_cached, 'cache');
       }
     }
     else {
