Skip to content

Commit

Permalink
add order of translation formats
Browse files Browse the repository at this point in the history
The preferred order of the different translation formats in
configuration blocks is Xliff, YAML, PHP. Thus, this has to be
documented in the contributing section. Since the order being used
before was Xliff, PHP, YAML, existing examples had to be modified
accordingly.
  • Loading branch information
xabbuh committed Aug 15, 2014
1 parent 2b1935b commit ef4dd23
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
20 changes: 10 additions & 10 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@ different formats, XLIFF being the recommended format:
</file>
</xliff>
.. code-block:: yaml
# messages.fr.yml
Symfony2 is great: J'aime Symfony2
.. code-block:: php
// messages.fr.php
return array(
'Symfony2 is great' => 'J\'aime Symfony2',
);
.. code-block:: yaml
# messages.fr.yml
Symfony2 is great: J'aime Symfony2
For information on where these files should be located, see
:ref:`book-translation-resource-locations`.

Expand Down Expand Up @@ -638,18 +638,18 @@ bundle.
</file>
</xliff>
.. code-block:: yaml
# validators.en.yml
author.name.not_blank: Please enter an author name.
.. code-block:: php
// validators.en.php
return array(
'author.name.not_blank' => 'Please enter an author name.',
);
.. code-block:: yaml
# validators.en.yml
author.name.not_blank: Please enter an author name.
Translating Database Content
----------------------------

Expand Down
10 changes: 5 additions & 5 deletions components/translation/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,18 @@ recommended format. These files are parsed by one of the loader classes.
</file>
</xliff>
.. code-block:: yaml
Symfony2 is great: J'aime Symfony2
symfony2.great: J'aime Symfony2
.. code-block:: php
return array(
'Symfony2 is great' => 'J\'aime Symfony2',
'symfony2.great' => 'J\'aime Symfony2',
);
.. code-block:: yaml
Symfony2 is great: J'aime Symfony2
symfony2.great: J'aime Symfony2
.. sidebar:: Using Real or Keyword Messages

This example illustrates the two different philosophies when creating
Expand Down
1 change: 1 addition & 0 deletions contributing/documentation/standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Configuration examples should show all supported formats using
* **Configuration** (including services and routing): YAML, XML, PHP
* **Validation**: YAML, Annotations, XML, PHP
* **Doctrine Mapping**: Annotations, YAML, XML, PHP
* **Translation**: XML, YAML, PHP

Example
~~~~~~~
Expand Down

0 comments on commit ef4dd23

Please sign in to comment.