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\View\Compilers\Concerns;
4
 
5
trait CompilesTranslations
6
{
7
    /**
8
     * Compile the lang statements into valid PHP.
9
     *
10
     * @param  string|null  $expression
11
     * @return string
12
     */
13
    protected function compileLang($expression)
14
    {
15
        if (is_null($expression)) {
16
            return '<?php $__env->startTranslation(); ?>';
17
        } elseif ($expression[1] === '[') {
18
            return "<?php \$__env->startTranslation{$expression}; ?>";
19
        }
20
 
21
        return "<?php echo app('translator')->get{$expression}; ?>";
22
    }
23
 
24
    /**
25
     * Compile the end-lang statements into valid PHP.
26
     *
27
     * @return string
28
     */
29
    protected function compileEndlang()
30
    {
31
        return '<?php echo $__env->renderTranslation(); ?>';
32
    }
33
 
34
    /**
35
     * Compile the choice statements into valid PHP.
36
     *
37
     * @param  string  $expression
38
     * @return string
39
     */
40
    protected function compileChoice($expression)
41
    {
42
        return "<?php echo app('translator')->choice{$expression}; ?>";
43
    }
44
}