public function getLocales()
    {
        // Cache by locale
        $locale = i18n::get_locale();
        if (!empty(static::$cache_locales[$locale])) {
            return static::$cache_locales[$locale];
        }

        // Localise all locales
        $locales = $this->config()->get('locales');
        $localised = [];
        foreach ($locales as $code => $default) {
            $localised[$code] = $this->localeName($code);
        }

        // Save cache
        static::$cache_locales[$locale] = $localised;
        return $localised;
    }