File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656 $ app [$ key ] = $ value ;
5757}
5858
59+ /*
60+ |--------------------------------------------------------------------------
61+ | Load The Application Translation Messages
62+ |--------------------------------------------------------------------------
63+ |
64+ | Here we'll load all of the language messages for the application, which
65+ | are all stored in a single language file. The translator service is
66+ | automatically registered for us via the core services provider.
67+ |
68+ */
69+
70+ $ messages = require __DIR__ .'/lang.php ' ;
71+
72+ $ domains = array ();
73+
74+ if (isset ($ app ['translator.domains ' ]))
75+ {
76+ $ domains = $ app ['translator.domains ' ];
77+ }
78+
79+ $ app ['translator.domains ' ] = array_merge ($ domains , compact ('messages ' ));
80+
5981/*
6082|--------------------------------------------------------------------------
6183| Register The Core Service Provider
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return array (
4+
5+ 'en ' => array (),
6+
7+ );
Original file line number Diff line number Diff line change 1414
1515$ app ->get ('/ ' , function () use ($ app )
1616{
17- /*
18- $app['locale'] = 'en';
19- $app->register(new Silex\Provider\TranslationServiceProvider, array(
20- 'locale' => 'en',
21- 'locale_fallback' => 'en',
22- 'translator.domains' => array(
23- 'messages' => array(
24- 'en' => array(
25- 'hello' => 'Hello, :name',
26- ),
27- ),
28- ),
29- ));
30- */
3117 return $ app ->twig ->render ('hello.twig.html ' );
3218});
Original file line number Diff line number Diff line change 11{
22 "require" : {
3- "illuminate/foundation" : " >=1.0.0" ,
3+ "illuminate/foundation" : " >=1.0.0"
44 }
55}
You can’t perform that action at this time.
0 commit comments