public function filter_locale($locale) { $user_language = $this->language_repository->get_user_language(); return $user_language ?: (string) $locale; }