Skip to content

Commit 820eed3

Browse files
committed
minor #4741 Fix grammar and spelling mistakes in documentation (fabpot)
This PR was merged into the 3.x branch. Discussion ---------- Fix grammar and spelling mistakes in documentation Commits ------- 77cd2fd Fix grammar and spelling mistakes in documentation
2 parents c02aa11 + 77cd2fd commit 820eed3

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

doc/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ templates from a database or other resources.
3535

3636
Notice that the second argument of the environment is an array of options.
3737
The ``cache`` option is a compilation cache directory, where Twig caches
38-
the compiled templates to avoid the parsing phase for sub-sequent
38+
the compiled templates to avoid the parsing phase for subsequent
3939
requests. It is very different from the cache you might want to add for
4040
the evaluated templates. For such a need, you can use any available PHP
4141
cache library.
@@ -196,7 +196,7 @@ methods::
196196
$loader->addPath($templateDir3);
197197
$loader->prependPath($templateDir4);
198198

199-
The filesystem loader also supports namespaced templates. This allows to group
199+
The filesystem loader also supports namespaced templates. This allows you to group
200200
your templates under different namespaces which have their own template paths.
201201

202202
When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods,

doc/deprecated.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Nodes
7272
deprecated.
7373

7474
* The ``Twig\Node\Expression\NameExpression::isSimple()`` and
75-
``Twig\Node\Expression\NameExpression::isSpecial()`` methods are deprecated as
75+
``Twig\Node\Expression\NameExpression::isSpecial()`` methods are deprecated as
7676
of Twig 3.11 and will be removed in Twig 4.0.
7777

7878
* The ``filter`` node of ``Twig\Node\Expression\FilterExpression`` is

doc/filters/escape.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ And here is how to escape variables included in JavaScript code:
3939
The ``escape`` filter supports the following escaping strategies for HTML
4040
documents:
4141

42-
* ``html``: escapes a string for the **HTML body** context,
42+
* ``html``: escapes a string for the **HTML body** context,
4343
or for HTML attributes values **inside quotes**.
4444

45-
* ``js``: escapes a string for the **JavaScript** context. This is intended for
46-
use in JavaScript or JSON strings, and encodes values using backslash escape
45+
* ``js``: escapes a string for the **JavaScript** context. This is intended for
46+
use in JavaScript or JSON strings, and encodes values using backslash escape
4747
sequences.
4848

4949
* ``css``: escapes a string for the **CSS** context. CSS escaping can be

doc/filters/filter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function. The arrow function receives the value of the sequence or mapping:
1111
{{ sizes|filter(v => v > 38)|join(', ') }}
1212
{# output 40, 42 #}
1313
14-
Combined with the ``for`` tag, it allows to filter the items to iterate over:
14+
Combined with the ``for`` tag, it allows you to filter the items to iterate over:
1515

1616
.. code-block:: twig
1717

doc/filters/slug.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
========
33

44
The ``slug`` filter transforms a given string into another string that
5-
only includes safe ASCII characters.
5+
only includes safe ASCII characters.
66

77
Here is an example:
88

@@ -11,8 +11,8 @@ Here is an example:
1111
{{ 'Wôrķšƥáçè ~~sèťtïñğš~~'|slug }}
1212
Workspace-settings
1313
14-
The default separator between words is a dash (``-``), but you can
15-
define a selector of your choice by passing it as an argument:
14+
The default separator between words is a dash (``-``), but you can
15+
define a separator of your choice by passing it as an argument:
1616

1717
.. code-block:: twig
1818
@@ -27,8 +27,8 @@ argument:
2727
2828
{{ '...'|slug('-', 'ko') }}
2929
30-
The ``slug`` filter uses the method by the same name in Symfony's
31-
`AsciiSlugger <https://symfony.com/doc/current/components/string.html#slugger>`_.
30+
The ``slug`` filter uses the method by the same name in Symfony's
31+
`AsciiSlugger <https://symfony.com/doc/current/components/string.html#slugger>`_.
3232

3333
.. note::
3434

doc/functions/country_timezones.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
=====================
33

44
The ``country_timezones`` function returns the names of the timezones associated
5-
with a given country its ISO-3166 code:
5+
with a given country code (ISO-3166):
66

77
.. code-block:: twig
88
99
{# Europe/Paris #}
1010
{{ country_timezones('FR')|join(', ') }}
1111
12-
If the specified country were to be unknown, it will return an empty array
12+
If the specified country is unknown, it will return an empty array.
1313

1414
.. note::
1515

doc/recipes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ catches deprecation notices, and return them.
3131
template names as keys and template contents as values (as done by
3232
``\Twig\Util\TemplateDirIterator``).
3333

34-
However, this code won't find all deprecations (like using deprecated some Twig
34+
However, this code won't find all deprecations (like using some deprecated Twig
3535
classes). To catch all notices, register a custom error handler like the one
3636
below::
3737

doc/tags/block.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Blocks are used for inheritance and act as placeholders and replacements at
55
the same time. They are documented in detail in the documentation for the
66
:doc:`extends<../tags/extends>` tag.
77

8-
Block names must consist of alphanumeric characters, and underscores. The first char can't be a digit and dashes are not permitted.
8+
Block names must consist of alphanumeric characters, and underscores. The first character can't be a digit and dashes are not permitted.
99

1010
.. seealso::
1111

doc/tags/cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ version of the template code, ``post.id`` represent the id of the blog post,
4242
and ``post.updated_at`` returns a timestamp that represents the time where the
4343
blog post was last modified.
4444

45-
Using such a strategy for naming cache keys allows to avoid using a ``ttl``.
45+
Using such a strategy for naming cache keys allows you to avoid using a ``ttl``.
4646
It's like using a "validation" strategy instead of an "expiration" strategy as
4747
we do for HTTP caches.
4848

doc/templates.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ Inline comments can also be on the same line as the expression:
342342
}}
343343
344344
As inline comments continue until the end of the current line, the following
345-
code does not work as ``}}``would be part of the comment:
345+
code does not work as ``}}`` would be part of the comment:
346346

347347
.. code-block:: twig
348348
@@ -591,7 +591,7 @@ exist:
591591

592592
* ``42`` / ``42.23``: Integers and floating point numbers are created by
593593
writing the number down. If a dot is present the number is a float,
594-
otherwise an integer. Underscores can be used as digits separator to
594+
otherwise an integer. Underscores can be used as digits separator to
595595
improve readability (``-3_141.592_65`` is equivalent to ``-3141.59265``).
596596

597597
* ``["first_name", "last_name"]``: Sequences are defined by a sequence of expressions
@@ -933,7 +933,7 @@ The following operators don't fit into any of the other categories:
933933
To resolve ``user.name`` to a PHP call, Twig uses the following algorithm
934934
at runtime:
935935

936-
* check if ``user`` is a PHP array or a ArrayObject/ArrayAccess object and
936+
* check if ``user`` is a PHP array or an ArrayObject/ArrayAccess object and
937937
``name`` a valid element;
938938
* if not, and if ``user`` is a PHP object, check that ``name`` is a valid property;
939939
* if not, and if ``user`` is a PHP object, check that ``name`` is a class constant;
@@ -959,7 +959,7 @@ The following operators don't fit into any of the other categories:
959959
Twig supports a specific syntax via the ``()`` operator for calling methods
960960
on objects, like in ``user.name()``:
961961

962-
* check if ``user`` is a object and has the ``name()``, ``getName()``,
962+
* check if ``user`` is an object and has the ``name()``, ``getName()``,
963963
``isName()``, or ``hasName()`` method;
964964
* if not, and if ``strict_variables`` is ``false``, return ``null``;
965965
* if not, throw an exception.

0 commit comments

Comments
 (0)