Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
ffff5bd5
Commit
ffff5bd5
authored
Mar 10, 2015
by
KhanhIceTea
Committed by
Fabien Potencier
Apr 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch debug and caching translator (Symfony 2.6+ with caching enabled).
parent
5d5046e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/Silex/Provider/TranslationServiceProvider.php
src/Silex/Provider/TranslationServiceProvider.php
+2
-1
src/Silex/Translator.php
src/Silex/Translator.php
+2
-2
No files found.
src/Silex/Provider/TranslationServiceProvider.php
View file @
ffff5bd5
...
@@ -28,7 +28,7 @@ class TranslationServiceProvider implements ServiceProviderInterface
...
@@ -28,7 +28,7 @@ class TranslationServiceProvider implements ServiceProviderInterface
public
function
register
(
Application
$app
)
public
function
register
(
Application
$app
)
{
{
$app
[
'translator'
]
=
$app
->
share
(
function
(
$app
)
{
$app
[
'translator'
]
=
$app
->
share
(
function
(
$app
)
{
$translator
=
new
Translator
(
$app
,
$app
[
'translator.message_selector'
]);
$translator
=
new
Translator
(
$app
,
$app
[
'translator.message_selector'
]
,
$app
[
'translator.cache_dir'
],
$app
[
'debug'
]
);
// Handle deprecated 'locale_fallback'
// Handle deprecated 'locale_fallback'
if
(
isset
(
$app
[
'locale_fallback'
]))
{
if
(
isset
(
$app
[
'locale_fallback'
]))
{
...
@@ -55,6 +55,7 @@ class TranslationServiceProvider implements ServiceProviderInterface
...
@@ -55,6 +55,7 @@ class TranslationServiceProvider implements ServiceProviderInterface
$app
[
'translator.domains'
]
=
array
();
$app
[
'translator.domains'
]
=
array
();
$app
[
'locale_fallbacks'
]
=
array
(
'en'
);
$app
[
'locale_fallbacks'
]
=
array
(
'en'
);
$app
[
'translator.cache_dir'
]
=
null
;
}
}
public
function
boot
(
Application
$app
)
public
function
boot
(
Application
$app
)
...
...
src/Silex/Translator.php
View file @
ffff5bd5
...
@@ -23,11 +23,11 @@ class Translator extends BaseTranslator
...
@@ -23,11 +23,11 @@ class Translator extends BaseTranslator
{
{
protected
$app
;
protected
$app
;
public
function
__construct
(
Application
$app
,
MessageSelector
$selector
)
public
function
__construct
(
Application
$app
,
MessageSelector
$selector
,
$cacheDir
=
null
,
$debug
=
false
)
{
{
$this
->
app
=
$app
;
$this
->
app
=
$app
;
parent
::
__construct
(
null
,
$selector
);
parent
::
__construct
(
null
,
$selector
,
$cacheDir
,
$debug
);
}
}
public
function
getLocale
()
public
function
getLocale
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment