Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
$loc = $this->location . '[' . var_export($name, TRUE) . ']';
if (is_string($ret)) {
$ret = array('en' => $ret,);
}
if (!is_array($ret)) {
throw new Exception($loc . ': Must be an array or a string.');
}
foreach ($ret as $k => $v) {
if (!is_string($k)) {
throw new Exception($loc . ': Invalid language code: ' . var_export($k, TRUE));
}
if (!is_string($v)) {
throw new Exception($loc . '[' . var_export($v, TRUE) . ']: Must be a string.');
}
}
return $ret;
}