Skip to content

Commit 93e8cd2

Browse files
committed
Merge branch '2.3' into 2.4
Conflicts: book/security.rst components/security/authentication.rst components/translation/introduction.rst
2 parents 4738c75 + f4c9536 commit 93e8cd2

39 files changed

+152
-136
lines changed

book/http_cache.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ The resulting HTTP header will look like this:
474474

475475
Note that in HTTP versions before 1.1 the origin server wasn't required to
476476
send the ``Date`` header. Consequently the cache (e.g. the browser) might
477-
need to rely onto his local clock to evaluate the ``Expires`` header making
477+
need to rely on the local clock to evaluate the ``Expires`` header making
478478
the lifetime calculation vulnerable to clock skew. Another limitation
479479
of the ``Expires`` header is that the specification states that "HTTP/1.1
480480
servers should not send ``Expires`` dates more than one year in the future."

book/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ file:
341341
342342
Now, the vendor directory won't be committed to source control. This is fine
343343
(actually, it's great!) because when someone else clones or checks out the
344-
project, he/she can simply run the ``php composer.phar install`` script to
344+
project, they can simply run the ``php composer.phar install`` script to
345345
install all the necessary project dependencies.
346346

347347
.. _`enable ACL support`: https://help.ubuntu.com/community/FilePermissionsACLs

book/security.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Security
55
========
66

77
Security is a two-step process whose goal is to prevent a user from accessing
8-
a resource that he/she should not have access to.
8+
a resource that they should not have access to.
99

1010
In the first step of the process, the security system identifies who the user
1111
is by requiring the user to submit some sort of identification. This is called
@@ -165,7 +165,7 @@ Firewalls (Authentication)
165165

166166
When a user makes a request to a URL that's protected by a firewall, the
167167
security system is activated. The job of the firewall is to determine whether
168-
or not the user needs to be authenticated, and if he does, to send a response
168+
or not the user needs to be authenticated, and if they do, to send a response
169169
back to the user initiating the authentication process.
170170

171171
A firewall is activated when the URL of an incoming request matches the configured
@@ -217,7 +217,7 @@ If the credentials are valid, the original request can be re-tried.
217217
:align: center
218218

219219
In this example, the user ``ryan`` successfully authenticates with the firewall.
220-
But since ``ryan`` doesn't have the ``ROLE_ADMIN`` role, he's still denied
220+
But since ``ryan`` doesn't have the ``ROLE_ADMIN`` role, they're still denied
221221
access to ``/admin/foo``. Ultimately, this means that the user will see some
222222
sort of message indicating that access has been denied.
223223

@@ -1041,7 +1041,7 @@ Access Control Lists (ACLs): Securing Individual Database Objects
10411041
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10421042

10431043
Imagine you are designing a blog system where your users can comment on your
1044-
posts. Now, you want a user to be able to edit his own comments, but not
1044+
posts. Now, you want a user to be able to edit their own comments, but not
10451045
those of other users. Also, as the admin user, you yourself want to be able
10461046
to edit *all* comments.
10471047

@@ -1800,7 +1800,7 @@ a route so that you can use it to generate the URL:
18001800
18011801
return $collection;
18021802
1803-
Once the user has been logged out, he will be redirected to whatever path
1803+
Once the user has been logged out, they will be redirected to whatever path
18041804
is defined by the ``target`` parameter above (e.g. the ``homepage``). For
18051805
more information on configuring the logout, see the
18061806
:doc:`Security Configuration Reference </reference/configuration/security>`.

book/templating.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ this classic example:
13591359

13601360
Hello <?php echo $name ?>
13611361

1362-
Imagine that the user enters the following code as his/her name:
1362+
Imagine the user enters the following code for their name:
13631363

13641364
.. code-block:: text
13651365

book/translation.rst

+21-17
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ into the language of the user::
2222

2323
The term *locale* refers roughly to the user's language and country. It
2424
can be any string that your application uses to manage translations and
25-
other format differences (e.g. currency format). The `ISO639-1`_
26-
*language* code, an underscore (``_``), then the `ISO3166 Alpha-2`_
25+
other format differences (e.g. currency format). The `ISO 639-1`_
26+
*language* code, an underscore (``_``), then the `ISO 3166-1 alpha-2`_
2727
*country* code (e.g. ``fr_FR`` for French/France) is recommended.
2828

2929
In this chapter, you'll learn how to use the Translation component in the
@@ -41,7 +41,8 @@ to learn even more. Overall, the process has several steps:
4141
for each supported locale that translate each message in the application;
4242

4343
#. Determine, :ref:`set and manage the user's locale <book-translation-user-locale>`
44-
for the request and optionally on the user's entire session.
44+
for the request and optionally
45+
:doc:`on the user's entire session </cookbook/session/locale_sticky_session>`.
4546

4647
.. _book-translation-configuration:
4748

@@ -147,11 +148,12 @@ different formats, XLIFF being the recommended format:
147148
# messages.fr.yml
148149
Symfony2 is great: J'aime Symfony2
149150
150-
For information on where these files should be located, see :ref:`book-translation-resource-locations`.
151+
For information on where these files should be located, see
152+
:ref:`book-translation-resource-locations`.
151153

152154
Now, if the language of the user's locale is French (e.g. ``fr_FR`` or ``fr_BE``),
153155
the message will be translated into ``J'aime Symfony2``. You can also translate
154-
message inside your :ref:`templates <book-translation-tags>`.
156+
the message inside your :ref:`templates <book-translation-tags>`.
155157

156158
The Translation Process
157159
~~~~~~~~~~~~~~~~~~~~~~~
@@ -278,8 +280,8 @@ texts* and complex expressions:
278280
Using the translation tags or filters have the same effect, but with
279281
one subtle difference: automatic output escaping is only applied to
280282
translations using a filter. In other words, if you need to be sure
281-
that your translated is *not* output escaped, you must apply the
282-
``raw`` filter after the translation filter:
283+
that your translated message is *not* output escaped, you must apply
284+
the ``raw`` filter after the translation filter:
283285

284286
.. code-block:: jinja
285287
@@ -290,7 +292,7 @@ texts* and complex expressions:
290292
291293
{% set message = '<h3>foo</h3>' %}
292294
293-
{# strings and variables translated via a filter is escaped by default #}
295+
{# strings and variables translated via a filter are escaped by default #}
294296
{{ message|trans|raw }}
295297
{{ '<h3>bar</h3>'|trans|raw }}
296298
@@ -303,7 +305,7 @@ texts* and complex expressions:
303305
{% trans_default_domain "app" %}
304306
305307
Note that this only influences the current template, not any "included"
306-
templates (in order to avoid side effects).
308+
template (in order to avoid side effects).
307309

308310
PHP Templates
309311
~~~~~~~~~~~~~
@@ -346,7 +348,7 @@ The filename of the translation files is also important: each message file
346348
must be named according to the following path: ``domain.locale.loader``:
347349

348350
* **domain**: An optional way to organize messages into groups (e.g. ``admin``,
349-
``navigation`` or the default ``messages``) - see ":ref:`using-message-domains`";
351+
``navigation`` or the default ``messages``) - see :ref:`using-message-domains`;
350352

351353
* **locale**: The locale that the translations are for (e.g. ``en_GB``, ``en``, etc);
352354

@@ -374,7 +376,7 @@ taste. For more options, see :ref:`component-translator-message-catalogs`.
374376

375377
Each time you create a *new* translation resource (or install a bundle
376378
that includes a translation resource), be sure to clear your cache so
377-
that Symfony can discover the new translation resource:
379+
that Symfony can discover the new translation resources:
378380

379381
.. code-block:: bash
380382
@@ -481,11 +483,13 @@ by the routing system using the special ``_locale`` parameter:
481483
return $collection;
482484
483485
When using the special ``_locale`` parameter in a route, the matched locale
484-
will *automatically be set on the user's session*. In other words, if a user
486+
will *automatically be set on the Request* and can be retrieved via the
487+
:method:`Symfony\\Component\\HttpFoundation\\Request::getLocale` method.
488+
In other words, if a user
485489
visits the URI ``/fr/contact``, the locale ``fr`` will automatically be set
486-
as the locale for the user's session.
490+
as the locale for the current request.
487491

488-
You can now use the user's locale to create routes to other translated pages
492+
You can now use the locale to create routes to other translated pages
489493
in your application.
490494

491495
Setting a Default Locale
@@ -651,7 +655,7 @@ steps:
651655
* Abstract messages in your application by wrapping each in either the
652656
:method:`Symfony\\Component\\Translation\\Translator::trans` or
653657
:method:`Symfony\\Component\\Translation\\Translator::transChoice` methods
654-
(learn about this in ":doc:`/components/translation/usage`");
658+
(learn about this in :doc:`/components/translation/usage`);
655659

656660
* Translate each message into multiple locales by creating translation message
657661
files. Symfony2 discovers and processes each file because its name follows
@@ -661,6 +665,6 @@ steps:
661665
be set on the user's session.
662666

663667
.. _`i18n`: http://en.wikipedia.org/wiki/Internationalization_and_localization
664-
.. _`ISO3166 Alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
665-
.. _`ISO639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
668+
.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
669+
.. _`ISO 639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
666670
.. _`Translatable Extension`: https://github.com/l3pp4rd/DoctrineExtensions

book/validation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ on that class. To do this, you can organize each constraint into one or more
692692
constraints.
693693

694694
For example, suppose you have a ``User`` class, which is used both when a
695-
user registers and when a user updates his/her contact information later:
695+
user registers and when a user updates their contact information later:
696696

697697
.. configuration-block::
698698

components/console/helpers/dialoghelper.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ if you want to know a bundle name, you can add this to your command::
4949
'AcmeDemoBundle'
5050
);
5151

52-
The user will be asked "Please enter the name of the bundle". She can type
53-
some name which will be returned by the ``ask`` method. If she leaves it empty,
52+
The user will be asked "Please enter the name of the bundle". They can type
53+
some name which will be returned by the ``ask`` method. If they leave it empty,
5454
the default value (``AcmeDemoBundle`` here) is returned.
5555

5656
Autocompletion
@@ -138,8 +138,8 @@ function should also return the value of the user's input if the validation was
138138
You can set the max number of times to ask in the ``$attempts`` argument.
139139
If you reach this max number it will use the default value, which is given
140140
in the last argument. Using ``false`` means the amount of attempts is infinite.
141-
The user will be asked as long as he provides an invalid answer and will only
142-
be able to proceed if her input is valid.
141+
The user will be asked as long as they provide an invalid answer and will only
142+
be able to proceed if their input is valid.
143143

144144
Validating a Hidden Response
145145
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -202,7 +202,7 @@ The option which should be selected by default is provided with the fourth
202202
argument. The default is ``null``, which means that no option is the default one.
203203

204204
If the user enters an invalid string, an error message is shown and the user
205-
is asked to provide the answer another time, until she enters a valid string
205+
is asked to provide the answer another time, until they enter a valid string
206206
or the maximum attempts is reached (which you can define in the fifth
207207
argument). The default value for the attempts is ``false``, which means infinite
208208
attempts. You can define your own error message in the sixth argument.

components/event_dispatcher/container_aware_dispatcher.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
single: EventDispatcher; Service container aware
33

44
The Container Aware Event Dispatcher
5-
===================================
5+
====================================
66

77
Introduction
88
------------

components/event_dispatcher/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Introduction
1111
Objected Oriented code has gone a long way to ensuring code extensibility. By
1212
creating classes that have well defined responsibilities, your code becomes
1313
more flexible and a developer can extend them with subclasses to modify their
14-
behaviors. But if he wants to share his changes with other developers who have
14+
behaviors. But if they want to share the changes with other developers who have
1515
also made their own subclasses, code inheritance is no longer the answer.
1616

1717
Consider the real-world example where you want to provide a plugin system for

components/form/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ method:
487487

488488
.. code-block:: php-standalone
489489
490-
use Symfony\HttpFoundation\Request;
490+
use Symfony\Component\HttpFoundation\Request;
491491
use Symfony\Component\HttpFoundation\RedirectResponse;
492492
493493
$form = $formFactory->createBuilder()

components/security/authentication.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Authenticating Users by their Username and Password
110110
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111111

112112
An authentication provider will attempt to authenticate a user based on
113-
the credentials he provided. Usually these are a username and a password.
113+
the credentials they provided. Usually these are a username and a password.
114114
Most web applications store their user's username and a hash of the user's
115115
password combined with a randomly generated salt. This means that the average
116116
authentication would consist of fetching the salt and the hashed password
@@ -225,4 +225,4 @@ which should be used to encode this user's password::
225225
$password,
226226
$user->getSalt());
227227

228-
.. _`CVE-2013-5750`: http://symfony.com/blog/cve-2013-5750-security-issue-in-fosuserbundle-login-form
228+
.. _`CVE-2013-5750`: http://symfony.com/blog/cve-2013-5750-security-issue-in-fosuserbundle-login-form

components/security/firewall.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ firewall map will jump in.
101101

102102
The exception listener determines what happens next, based on the arguments
103103
it received when it was created. It may start the authentication procedure,
104-
perhaps ask the user to supply his credentials again (when he has only been
104+
perhaps ask the user to supply their credentials again (when they have only been
105105
authenticated based on a "remember-me" cookie), or transform the exception
106106
into an :class:`Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException`,
107107
which will eventually result in an "HTTP/1.1 403: Access Denied" response.
@@ -119,7 +119,7 @@ object and the exception by which the exception listener was triggered.
119119
The method should return a :class:`Symfony\\Component\\HttpFoundation\\Response`
120120
object. This could be, for instance, the page containing the login form or,
121121
in the case of Basic HTTP authentication, a response with a ``WWW-Authenticate``
122-
header, which will prompt the user to supply his username and password.
122+
header, which will prompt the user to supply their username and password.
123123

124124
Flow: Firewall, Authentication, Authorization
125125
---------------------------------------------

components/translation/introduction.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Installation
1313

1414
You can install the component in 2 different ways:
1515

16-
* :doc:`Install it via Composer</components/using_components>` (``symfony/translation`` on `Packagist`_).
17-
* Use the official Git repository (https://github.com/symfony/Translation);
16+
* :doc:`Install it via Composer </components/using_components>` (``symfony/translation`` on `Packagist`_);
17+
* Use the official Git repository (https://github.com/symfony/Translation).
1818

1919
Constructing the Translator
2020
---------------------------
2121

22-
The main access point of the Translation Component is
22+
The main access point of the Translation component is
2323
:class:`Symfony\\Component\\Translation\\Translator`. Before you can use it,
2424
you need to configure it and load the messages to translate (called *message
2525
catalogs*).
@@ -45,8 +45,8 @@ The constructor of the ``Translator`` class needs one argument: The locale.
4545

4646
The term *locale* refers roughly to the user's language and country. It
4747
can be any string that your application uses to manage translations and
48-
other format differences (e.g. currency format). The `ISO639-1`_
49-
*language* code, an underscore (``_``), then the `ISO3166 Alpha-2`_
48+
other format differences (e.g. currency format). The `ISO 639-1`_
49+
*language* code, an underscore (``_``), then the `ISO 3166-1 alpha-2`_
5050
*country* code (e.g. ``fr_FR`` for French/France) is recommended.
5151

5252
.. _component-translator-message-catalogs:
@@ -59,7 +59,7 @@ class. A message catalog is like a dictionary of translations for a specific
5959
locale.
6060

6161
The Translation component uses Loader classes to load catalogs. You can load
62-
multiple resources for the same locale, it will be combined into one
62+
multiple resources for the same locale, which will then be combined into one
6363
catalog.
6464

6565
The component comes with some default Loaders and you can create your own
@@ -88,7 +88,7 @@ Loader too. The default loaders are:
8888
* :class:`Symfony\\Component\\Translation\\Loader\\YamlFileLoader` - to load
8989
catalogs from Yaml files (requires the :doc:`Yaml component</components/yaml/introduction>`).
9090

91-
All file loaders require the :doc:`Config component</components/config/index>`.
91+
All file loaders require the :doc:`Config component </components/config/index>`.
9292

9393
At first, you should add one or more loaders to the ``Translator``::
9494

@@ -198,8 +198,8 @@ specified locale.
198198
Usage
199199
-----
200200

201-
Read how to use the Translation component in ":doc:`/components/translation/usage`".
201+
Read how to use the Translation component in :doc:`/components/translation/usage`.
202202

203203
.. _Packagist: https://packagist.org/packages/symfony/translation
204-
.. _`ISO3166 Alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
205-
.. _`ISO639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
204+
.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
205+
.. _`ISO 639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

components/translation/usage.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Imagine you want to translate the string *"Symfony2 is great"* into French::
1414
$translator->addResource('array', array(
1515
'Symfony2 is great!' => 'J\'aime Symfony2!',
1616
), 'fr_FR');
17-
17+
1818
echo $translator->trans('Symfony2 is great!');
1919

2020
In this example, the message *"Symfony2 is great!"* will be translated into
@@ -81,7 +81,7 @@ is done just as before:
8181

8282
The placeholders can take on any form as the full message is reconstructed
8383
using the PHP :phpfunction:`strtr function<strtr>`. But the ``%...%`` form
84-
is recommend, to avoid problems when using Twig.
84+
is recommended, to avoid problems when using Twig.
8585

8686
As you've seen, creating a translation is a two-step process:
8787

@@ -257,7 +257,7 @@ To translate pluralized messages, use the
257257
array('%count%' => 10)
258258
);
259259

260-
The second argument (``10`` in this example), is the *number* of objects being
260+
The second argument (``10`` in this example) is the *number* of objects being
261261
described and is used to determine which translation to use and also to populate
262262
the ``%count%`` placeholder.
263263

contributing/documentation/overview.rst

+4-5
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ Translating
178178

179179
Read the dedicated :doc:`document <translations>`.
180180

181-
.. _`fork`: https://help.github.com/articles/fork-a-repo
182-
.. _`pull requests`: https://help.github.com/articles/using-pull-requests
183-
.. _`Documentation Build Errors`: http://symfony.com/doc/build_errors
184-
185181
Managing Releases
186182
-----------------
187183

@@ -226,4 +222,7 @@ happens, the following items are done:
226222
For example, in installation chapters, we reference the version you should
227223
use for installation. As an example, see the changes made in `PR #2688`_.
228224

229-
.. _`PR #2688`: https://github.com/symfony/symfony-docs/pull/2688
225+
.. _`fork`: https://help.github.com/articles/fork-a-repo
226+
.. _`pull requests`: https://help.github.com/articles/using-pull-requests
227+
.. _`Documentation Build Errors`: http://symfony.com/doc/build_errors
228+
.. _`PR #2688`: https://github.com/symfony/symfony-docs/pull/2688

0 commit comments

Comments
 (0)