Load a local namespaced translation group for overrides.

@param  array  $lines
@param  string  $locale
@param  string  $group
@param  string  $namespace
@return array
773466
protected function loadNamespaceOverrides(array $lines, $locale, $group, $namespace)
    {
        $file = "{$this->path}/vendor/{$namespace}/{$locale}/{$group}.php";

        if (file_exists($file)) {
            return array_replace_recursive($lines, (require $file));
        }

        return $lines;
    }
1300447
public function getFrom($group, $locale, $default = null)
    {
        if ( ! $this->hasCollection($group))
            return $default;

        $locales = $this->getCollection($group);

        return $locales->get($locale, $default);
    }
826094
protected function load($locale)
    {
        if (isset($this->loadedLocales[$locale])) {
            return;
        }

        // Add full locale file. E.g. 'en_NZ'
        $this
            ->getTranslator()
            ->addResource('ss', $this->getSourceDirs(), $locale);

        // Add lang-only file. E.g. 'en'
        $lang = i18n::getData()->langFromLocale($locale);
        if ($lang !== $locale) {
            $this
                ->getTranslator()
                ->addResource('ss', $this->getSourceDirs(), $lang);
        }


        $this->loadedLocales[$locale] = true;
    }
586427
protected function loadPath($path, $locale, $group)
	{
		if ($this->files->exists($full = "{$path}/{$locale}/{$group}.php"))
		{
			return $this->files->getRequire($full);
		}

		return array();
	}
142008
public function getItems($locale, $namespace, $group)
    {
        return $this->model
            ->whereLocale($locale)
            ->whereNamespace($namespace)
            ->whereGroup($group)
            ->get()
            ->toArray();
    }
1006623
protected function getTranslationOrNew($locale)
    {
        if (($translation = $this->getTranslation($locale)) === null) {
            $translation = $this->createNewTranslation($locale);
        }

        return $translation;
    }
729618
public function loadSource($locale, $group, $namespace = '*')
    {
        $dotArray = $this->translationRepository->loadSource($locale, $namespace, $group);
        $undot    = [];
        foreach ($dotArray as $item => $text) {
            array_set($undot, $item, $text);
        }
        return $undot;
    }
152591
private function getNamespaces(string $locale): array
    {
        $result = $this->hasLocale($locale) === true ? array_keys($this->getBundles()[$locale]) : [];

        return $result;
    }
412794
private function parse($locale)
    {
        $parts = explode('_', $locale);

        $localization = new Localization();
        $localization->setLanguage($parts[0]);
        if (count($parts) > 1) {
            $localization->setCountry($parts[1]);
        }

        return $localization;
    }
471070
protected function loadLangList($locale, $group)
    {
        $translations = app('translator')->getLoader()->load($locale, $group);

        return Arr::dot([$group => $translations]);
    }
513531
protected function loadDefinitions($locale)
    {
        if (!isset($this->definitions[$locale])) {
            $filename = $this->definitionPath . $locale . '.json';
            $this->definitions[$locale] = json_decode(file_get_contents($filename), true);
        }

        return $this->definitions[$locale];
    }
1007788
protected static function loadLocaleResource($locale)
    {
        $translator = static::translator();
        if ($translator instanceof Translator) {
            foreach (static::getLocaleResourceFilepaths($locale) as $filepath) {
                if (is_readable($filepath)) {
                    $translator->addResource('array', require $filepath, $locale);

                    return true;
                }
            }

            return false;
        }

        return true;
    }
17342
public function load( $locale, $group, $namespace = null )
	{
		$namespace = $namespace ?: '*';

		if ( isset( $this->messages[$namespace][$locale][$group] ) )
		{
			return $this->messages[$namespace][$locale][$group];
		}

		return [];
	}
525659
private function createGroups(array $namespaces)
    {
        $groups = [];

        foreach ($this->groups as $group) {
            if (is_array($group)) {
                $groups[] = array_fill_keys($group, []);
            } else {
                $groups[$group] = [];
            }
        }

        if (!array_key_exists('_main', $groups)) {
            $groups = array_merge(
                ['_main' => []],
                $groups
            );
        }

        foreach ($namespaces as $namespace) {
            foreach ($groups as $groupKey => $group) {
                if (is_int($groupKey)) {
                    foreach ($group as $subGroupKey => $subGroup) {
                        if (strpos($namespace, $subGroupKey) === 0) {
                            array_push($groups[$groupKey][$subGroupKey], $namespace);

                            continue 3;
                        }
                    }
                } elseif (is_string($groupKey) && strpos($namespace, $groupKey) === 0) {
                    array_push($groups[$groupKey], $namespace);

                    continue 2;
                }
            }

            array_push($groups['_main'], $namespace);
        }

        return $groups;
    }
1278541
protected function getLine($namespace, $group, $locale, $item, array $replace)
    {
        $this->load($namespace, $group, $locale);

        $line = Arr::get($this->loaded[$namespace][$group][$locale], $item);

        if (is_string($line)) {
            return $this->makeReplacements($line, $replace);
        } elseif (is_array($line) && count($line) > 0) {
            foreach ($line as $key => $value) {
                $line[$key] = $this->makeReplacements($value, $replace);
            }

            return $line;
        }
    }
207294
protected function loadMessagesFromFile($locale)
    {
        if (isset($this->messages[$locale])) {
            return true;
        }

        return $this->resetMessages($locale);
    }
337982
protected function loadNamespaced($locale, $group, $namespace)
    {
        if (isset($this->hints[$namespace])) {
            $lines = $this->loadPath($this->hints[$namespace], $locale, $group);

            return $this->loadNamespaceOverrides($lines, $locale, $group, $namespace);
        }

        return [];
    }