Load the messages strictly for the given locale.

@param string $locale
@param string $group
@param string $namespace

@return array
975138
public function load($locale, $group, $namespace = null)
    {
        // Load from files
        if ($group == '*' && $namespace == '*') {
            return $this->loadJsonPaths($locale);
        }
        if (is_null($namespace) || $namespace == '*') {
            $translationsFromFiles = $this->loadPath($this->path, $locale, $group);
        } else {
            $translationsFromFiles = $this->loadNamespaced($locale, $group, $namespace);
        }

        // If group is 'db', get data from DB.
        $translationsFromDB = ($group == 'db') ? $this->loadFromDB($locale, $group, $namespace) : [];

        return array_merge($translationsFromFiles, $translationsFromDB);
    }
22531
public function load($locale, $group, $namespace = null)
    {
        if ($locale != $this->defaultLocale) {
            return array_replace_recursive(
                $this->loadSource($this->defaultLocale, $group, $namespace),
                $this->loadSource($locale, $group, $namespace)
            );
        }
        return $this->loadSource($locale, $group, $namespace);
    }
1336480
protected function fetchMessagesFromNamespace($namespace)
    {
        $this->setNamespace($namespace);

        if ($this->hasMessages()) {
            $messages = $this->getMessagesFromNamespace($namespace);
            // reset namespace
            $this->setNamespace();

            return $this->buildMessage($namespace, $messages);
        }

        return '';
    }
1326574
public function addLines(array $lines, $locale, $namespace = '*')
    {
        foreach ($lines as $key => $value) {
            list($group, $item) = explode('.', $key, 2);
            Arr::set($this->loaded, "$namespace.$group.$locale.$item", $value);
        }
    }
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];
    }
599532
public static function getDisplayLocales($locale)
    {
        if (!isset(self::$locales[$locale])) {
            self::$locales[$locale] = Intl::getLocaleBundle()->getLocaleNames($locale);
        }

        return self::$locales[$locale];
    }
422169
public function load($locale, $group, $namespace = null)
	{
		if (is_null($namespace) || $namespace == '*')
		{
			return $this->loadData($locale, $group);
		}

		return $this->loadNamespaced($locale, $group, $namespace);
	}
348690
public function loadArray(array $lines, $locale, $group, $namespace = '*')
    {
        // Transform the lines into a flat dot array:
        $lines = array_dot($lines);
        foreach ($lines as $item => $text) {
            if (is_string($text)) {
                // Check if the entry exists in the database:
                $translation = Translation::whereLocale($locale)
                    ->whereNamespace($namespace)
                    ->whereGroup($group)
                    ->whereItem($item)
                    ->first();

                // If the translation already exists, we update the text:
                if ($translation && !$translation->isLocked()) {
                    $translation->text = $text;
                    $saved             = $translation->save();
                    if ($saved && $translation->locale === $this->defaultLocale) {
                        $this->flagAsUnstable($namespace, $group, $item);
                    }
                }
                // If no entry was found, create it:
                else {
                    $this->create(compact('locale', 'namespace', 'group', 'item', 'text'));
                }
            }
        }
    }
1085748
public function getByKey($key, $locale, $group = null) {
        $query = $this->source
            ->select('languages.slug as locale', 'translations.*')
            ->join('languages', 'languages.id', '=','translations.language_id')
            ->where('languages.slug', $locale)
            ->whereKey($key);

        if($group)
            $query->where('group', $group);

        return $query
            ->first();
    }
779784
public function loadSource($locale, $namespace, $group)
    {
        return $this->model
            ->whereLocale($locale)
            ->whereNamespace($namespace)
            ->whereGroup($group)
            ->get()
            ->keyBy('item')
            ->map(function ($translation) {
                return $translation['text'];
            })
            ->toArray();
    }
246192
public function load($locale, $group, $namespace = null)
    {
        $query = \DB::table('translations')
            ->where('locale', $locale)
            ->where('group', $group);

        return ServiceProvider::pluckOrLists($query, 'value', 'name');
    }
405886
protected function normaliseMessages($messages, $locale)
    {
        foreach ($messages as $key => $value) {
            $messages[$key] = $this->normaliseMessage($key, $value, $locale);
        }
        return $messages;
    }
1097248
protected function defaultLoad($environment, $group, $namespace = null)
    {
        $items = [];

        // First we'll get the root configuration path for the environment which is
        // where all of the configuration files live for that namespace, as well
        // as any environment folders with their specific configuration items.
        $path = $this->getPath($namespace);

        if ($path === null) {
            return $items;
        }

        // First we'll get the main configuration file for the groups. Once we have
        // that we can check for any environment specific files, which will get
        // merged on top of the main arrays to make the environments cascade.
        $file = "{$path}/{$group}.php";

        if ($this->files->exists($file)) {
            $items = $this->getRequire($file);
        }

        // Finally we're ready to check for the environment specific configuration
        // file which will be merged on top of the main arrays so that they get
        // precedence over them if we are currently in an environments setup.
        $file = "{$path}/{$environment}/{$group}.php";

        if ($this->files->exists($file)) {
            $items = $this->mergeEnvironment($items, $file);
        }

        return $items;
    }
130185
public function allToArray($locale, $group, $namespace = null)
    {
        $args = func_get_args();
        $args[] = config('app.locale');

        return $this->executeCallback(static::class, __FUNCTION__, $args, function () use ($locale, $group) {
            $array = DB::table('translations')
                    ->select(DB::raw("JSON_UNQUOTE(JSON_EXTRACT(`translation`, '$.".$locale."')) AS translation"), 'key')
                    ->where('group', $group)
                    ->pluck('translation', 'key')
                    ->all();

            return $array;
        });
    }
6768
public function all($locale = null){

        if(!$locale){
            $locale = $this->getLocale();
        }

        $this->load($locale);

        $translations = collect([]);
        foreach($this->languages[$locale] as $key => $arg){
            $translations->put($key, $arg['value']);
        }

        return $translations;
    }
775230
public function flagAsUnstable($namespace, $group, $item)
    {
        $this->model->whereNamespace($namespace)->whereGroup($group)->whereItem($item)->where('locale', '!=', $this->defaultLocale)->update(['unstable' => '1']);
    }
170853
public function load($group, $namespace = null)
    {
        $items = [];

        $path = $this->getPath($namespace);

        if (is_null($path)) {
            return $items;
        }

        $file = "{$path}/{$group}.php";

        if ($this->files->exists($file)) {
            $items = $this->getRequire($file);
        }

        return $items;
    }