public function translate($key)
{
// inproper param given
if (!is_string($key) && !is_int($key)) {
throw new \InvalidArgumentException("Invalid argument provided, string required!");
// value provided not found in dictionary -> return it with slug
// converted to a space
} elseif (!array_key_exists($key, $this->dictionary)) {
return preg_replace('/\\' . $this->config->value('slug_separator') . '/', ' ', $key);
} else {
// return with the translated value
return $this->dictionary[$key];
}
}