public function getLocalizedFieldnames(ModelHistory $historyEntry): string
    {
        $fields = join(', ', array_map(function ($value) use ($historyEntry) {
            if (!is_string($value)) {
                return $value;
            }

            // Get pre configured translations and return it if found
            $fields = TableRegistry::get($historyEntry->model)->getFields();

            if (isset($fields[$value]['translation'])) {
                if (is_callable($fields[$value]['translation'])) {
                    return $fields[$value]['translation']();
                }

                return $fields[$value]['translation'];
            }

            // Try to get the generic model.field translation string
            $localeSlug = strtolower(Inflector::singularize(Inflector::delimit($historyEntry->model))) . '.' . strtolower($value);
            $translatedString = __($localeSlug);

            // Return original value when no translation was made
            if ($localeSlug == $translatedString) {
                return $value;
            }

            return $translatedString;
        }, array_keys($historyEntry->data)));

        return $fields;
    }