Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Translation;
4
 
5
use Illuminate\Contracts\Translation\Loader;
6
 
7
class ArrayLoader implements Loader
8
{
9
    /**
10
     * All of the translation messages.
11
     *
12
     * @var array
13
     */
14
    protected $messages = [];
15
 
16
    /**
17
     * Load the messages for the given locale.
18
     *
19
     * @param  string  $locale
20
     * @param  string  $group
21
     * @param  string|null  $namespace
22
     * @return array
23
     */
24
    public function load($locale, $group, $namespace = null)
25
    {
26
        $namespace = $namespace ?: '*';
27
 
28
        return $this->messages[$namespace][$locale][$group] ?? [];
29
    }
30
 
31
    /**
32
     * Add a new namespace to the loader.
33
     *
34
     * @param  string  $namespace
35
     * @param  string  $hint
36
     * @return void
37
     */
38
    public function addNamespace($namespace, $hint)
39
    {
40
        //
41
    }
42
 
43
    /**
44
     * Add a new JSON path to the loader.
45
     *
46
     * @param  string  $path
47
     * @return void
48
     */
49
    public function addJsonPath($path)
50
    {
51
        //
52
    }
53
 
54
    /**
55
     * Add messages to the loader.
56
     *
57
     * @param  string  $locale
58
     * @param  string  $group
59
     * @param  array  $messages
60
     * @param  string|null  $namespace
61
     * @return $this
62
     */
63
    public function addMessages($locale, $group, array $messages, $namespace = null)
64
    {
65
        $namespace = $namespace ?: '*';
66
 
67
        $this->messages[$namespace][$locale][$group] = $messages;
68
 
69
        return $this;
70
    }
71
 
72
    /**
73
     * Get an array of all the registered namespaces.
74
     *
75
     * @return array
76
     */
77
    public function namespaces()
78
    {
79
        return [];
80
    }
81
}