protected function getTranslatedMessages(array $messageKeys, $locale)
    {
        $translatedMessages = [];

        foreach ($messageKeys as $key) {
            $translation = Lang::get($key, [], $locale);

            if (is_array($translation)) {
                $flattened = $this->flattenTranslations($translation, $key.'.');
                $translatedMessages = array_merge($translatedMessages, $flattened);
            } else {
                $translatedMessages[$key] = $translation;
            }
        }

        return $translatedMessages;
    }