but the code i gave you is indeed wrong .. sine this will only work if the locale is mapped in the document

the better way to get the current locale would be:
```
$oid = spl_object_hash($document);
if (isset($this->documentLocales[$oid]['current'])) {
    $childrenHints = array('locale' => $this->documentLocales[$oid]['current']);
} else {
```