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
64901b7c
Commit
64901b7c
authored
May 01, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some doc markup issues
parent
ff8d2a16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
doc/providers/translation.rst
doc/providers/translation.rst
+3
-2
No files found.
doc/providers/translation.rst
View file @
64901b7c
...
...
@@ -121,7 +121,6 @@ to map languages to files::
Finally override the ``translator.loader`` to use a ``YamlFileLoader`` instead
of the default ``ArrayLoader``::
use Symfony\Component\Translation\Loader\YamlFileLoader;
$app['translator.loader'] = $app->share(function () {
...
...
@@ -131,7 +130,7 @@ of the default ``ArrayLoader``::
That's all you need to load translations from YAML files.
XLIFF-based language files
~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~
~
Just as you would do with YAML translation files, you first need to make
sure you have the ``Config`` component from Symfony2, and that it is
...
...
@@ -155,6 +154,7 @@ Accessing translations in Twig templates
Once loaded, the translation service provider is available from within Twig templates:
.. code-block:: jinja
{{ app.translator.trans('translation_key') }}
Even better: register the :doc:`SymfonyBridgesServiceProvider <providers/symfony_bridges>` and you will get
...
...
@@ -162,6 +162,7 @@ the TranslationExtension of the bridge allowing you to translate strings in
the Twig way:
.. code-block:: jinja
{{ 'translation_key'|trans }}
{{ 'translation_key'|transchoice }}
{% trans %}translation_key{% endtrans %}
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