Skip to content

Commit ff94d3f

Browse files
committed
work on translation.
1 parent 20905b1 commit ff94d3f

5 files changed

Lines changed: 41 additions & 33 deletions

File tree

app/bulbs/local.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22

33
return array(
44

5-
'app' => array(
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Application Debug Mode
8+
|--------------------------------------------------------------------------
9+
|
10+
| When your application is in debug mode, detailed error messages with
11+
| stack traces will be shown on every error that occurs within your
12+
| application. When disabled, a simple, generic error is shown.
13+
|
14+
*/
615

7-
/*
8-
|--------------------------------------------------------------------------
9-
| Application Debug Mode
10-
|--------------------------------------------------------------------------
11-
|
12-
| When your application is in debug mode, detailed error messages with
13-
| stack traces will be shown on every error that occurs within your
14-
| application. When disabled, a simple, generic error is shown.
15-
|
16-
*/
17-
18-
'debug' => true,
19-
20-
),
16+
'debug' => true,
2117

2218
);

app/bulbs/production.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@
22

33
return array(
44

5-
'app' => array(
6-
7-
/*
8-
|--------------------------------------------------------------------------
9-
| Application Debug Mode
10-
|--------------------------------------------------------------------------
11-
|
12-
| When your application is in debug mode, detailed error messages with
13-
| stack traces will be shown on every error that occurs within your
14-
| application. When disabled, a simple, generic error is shown.
15-
|
16-
*/
17-
18-
'debug' => false,
19-
20-
),
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Application Debug Mode
8+
|--------------------------------------------------------------------------
9+
|
10+
| When your application is in debug mode, detailed error messages with
11+
| stack traces will be shown on every error that occurs within your
12+
| application. When disabled, a simple, generic error is shown.
13+
|
14+
*/
15+
16+
'debug' => false,
2117

2218
'encrypter' => array(
2319

app/routes.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,19 @@
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+
*/
1731
return $app->twig->render('hello.twig.html');
1832
});

app/views/hello.twig.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<h1>Hello World!</h1>
1+
<h1>Hello World!</h1>
2+
3+
{{ "hello"|trans({':name': 'Taylor'}) }}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"illuminate/foundation": ">=1.0.0"
3+
"illuminate/foundation": ">=1.0.0",
44
}
55
}

0 commit comments

Comments
 (0)