src/Manager.php
public function cachedTranslations($namespace, $group, $locale, $translations = null)
    {
        $group = self::fixGroup($group);
        $group = $namespace && $namespace !== '*' ? $namespace . '::' . $group : $group;
        $translations = $translations ?: [];

        $values = $group && array_key_exists($group, $this->cache()) ? $this->cache[$group] : null;
        if ($values) {
            $localePrefix = "$locale:";
            $prefixLen = strlen($localePrefix);
            foreach ($values as $key => $translation) {
                if (str_starts_with($key, $localePrefix)) {
                    $transKey = substr($key, $prefixLen);
                    $translations[$transKey] = $translation;
                }
            }
        }

        return $translations;
    }
public function cachedTranslations($namespace, $group, $locale, $translations = null)
    {
        $group = self::fixGroup($group);
        $group = $namespace && $namespace !== '*' ? $namespace . '::' . $group : $group;
        $translations = $translations ?: [];

        $values = $group && array_key_exists($group, $this->cache()) ? $this->cache[$group] : null;
        if ($values) {
            $localePrefix = "$locale:";
            $prefixLen = strlen($localePrefix);
            foreach ($values as $key => $translation) {
                if (str_starts_with($key, $localePrefix)) {
                    $transKey = substr($key, $prefixLen);
                    $translations[$transKey] = $translation;
                }
            }
        }

        return $translations;
    }
@param $namespace
@param $group
@param $locale
@param $translations array|null  translations to override with cached translations

@return array   of key=>translation of cached translations for the locale