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
ac9dd1f2
Commit
ac9dd1f2
authored
Mar 27, 2012
by
Benoit Pointet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added shared services
parent
ccb0452a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
doc/providers/translation.rst
doc/providers/translation.rst
+12
-4
No files found.
doc/providers/translation.rst
View file @
ac9dd1f2
...
@@ -121,9 +121,14 @@ to map languages to files::
...
@@ -121,9 +121,14 @@ to map languages to files::
Finally override the ``translator.loader`` to use a ``YamlFileLoader`` instead
Finally override the ``translator.loader`` to use a ``YamlFileLoader`` instead
of the default ``ArrayLoader``::
of the default ``ArrayLoader``::
$app['translator.loader'] = new Symfony\Component\Translation\Loader\YamlFileLoader();
And that's all you need to load translations from YAML files.
use Symfony\Component\Translation\Loader\YamlFileLoader;
$app['translator.loader'] = $app->share(function () {
return new YamlFileLoader();
});
That's all you need to load translations from YAML files.
XLIFF-based language files
XLIFF-based language files
~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~
...
@@ -136,10 +141,13 @@ Then, similarly, create XLIFF files in your locales directory and setup the ``tr
...
@@ -136,10 +141,13 @@ Then, similarly, create XLIFF files in your locales directory and setup the ``tr
Finally override the ``translator.loader`` to use a ``XliffFileLoader``::
Finally override the ``translator.loader`` to use a ``XliffFileLoader``::
$app['translator.loader'] = new Symfony\Component\Translation\Loader\XliffFileLoader()
;
use Symfony\Component\Translation\Loader\XliffFileLoader
;
That's it.
$app['translator.loader'] = $app->share(function () {
return new XliffFileLoader();
});
That's it.
Accessing translations in Twig templates
Accessing translations in Twig templates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
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