Skip to content

Commit 6b76372

Browse files
committed
Properly nest Translator methods under class
1 parent 31cc99c commit 6b76372

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

docs/components/translator.rst

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,37 +63,37 @@ In PHP templates, use ``$view['translator']`` to access the Translator service.
6363

6464
.. php:class:: Mautic\CoreBundle\Translation\Translator
6565
66-
.. php:method:: trans(string $id[, array $parameters = [], ?string $domain = null, ?string $locale = null])
66+
.. php:method:: trans(string $id[, array $parameters = [], ?string $domain = null, ?string $locale = null])
6767
68-
Returns the translation for the given key.
68+
Returns the translation for the given key.
6969

70-
:param array $parameters: Parameters as key/value pairs to populate placeholders in the translation. Note that Symfony has deprecated `transChoice()` in favor of using this method plus defining the key ``%count%`` in ``$parameters``. For example, ``echo $translator->trans('helloworld.number_of_moons', ['%count%' => 1, '%world% => 'Earth']);`` with the translation, ``"helloworld.number_of_moons="{0}%world% has no moons|{1}%world% has one moon|]1,Inf[ %world% has %count% moons"``.
71-
:param string|null $domain: Specific domain to look for the translation key. Defaults to ``messages`` if ``NULL``.
72-
:param string|null $locale: Specific locale to look for the translation key. Defaults to system or user configured locale.
70+
:param array $parameters: Parameters as key/value pairs to populate placeholders in the translation. Note that Symfony has deprecated `transChoice()` in favor of using this method plus defining the key ``%count%`` in ``$parameters``. For example, ``echo $translator->trans('helloworld.number_of_moons', ['%count%' => 1, '%world% => 'Earth']);`` with the translation, ``"helloworld.number_of_moons="{0}%world% has no moons|{1}%world% has one moon|]1,Inf[ %world% has %count% moons"``.
71+
:param string|null $domain: Specific domain to look for the translation key. Defaults to ``messages`` if ``NULL``.
72+
:param string|null $locale: Specific locale to look for the translation key. Defaults to system or user configured locale.
7373

74-
:returns: Returns the translated string if the key is found. Otherwise, an empty string.
75-
:returntype: string
74+
:returns: Returns the translated string if the key is found. Otherwise, an empty string.
75+
:returntype: string
7676

77-
.. php:method:: transConditional(string $preferred, string $alternative[, array $parameters = [], ?string $domain = null, ?string $locale = null])
77+
.. php:method:: transConditional(string $preferred, string $alternative[, array $parameters = [], ?string $domain = null, ?string $locale = null])
7878
79-
Translates the preferred key if it exists and the alternate key if it does not.
79+
Translates the preferred key if it exists and the alternate key if it does not.
8080

81-
:param string $preferred: Preferred translation key.
82-
:param string $alternative: Alternate translation key if the preferred does does not exist.
83-
:param array $parameters: Parameters as key/value pairs to populate placeholders in the translation.
84-
:param string|null $domain: Specific domain to look for the translation key. Defaults to ``messages`` if ``NULL``.
85-
:param string|null $locale: Specific locale to look for the translation key. Defaults to system or user configured locale.
81+
:param string $preferred: Preferred translation key.
82+
:param string $alternative: Alternate translation key if the preferred does does not exist.
83+
:param array $parameters: Parameters as key/value pairs to populate placeholders in the translation.
84+
:param string|null $domain: Specific domain to look for the translation key. Defaults to ``messages`` if ``NULL``.
85+
:param string|null $locale: Specific locale to look for the translation key. Defaults to system or user configured locale.
8686

87-
:returns: Returns the translated string if the key is found. Otherwise, an empty string.
88-
:returntype: string
87+
:returns: Returns the translated string if the key is found. Otherwise, an empty string.
88+
:returntype: string
8989

90-
.. php:method:: hasId(string $id[, ?string $domain = null, ?string $local = null])
90+
.. php:method:: hasId(string $id[, ?string $domain = null, ?string $local = null])
9191
92-
Checks to see if a translation key exists.
92+
Checks to see if a translation key exists.
9393

94-
:param string $id: Translation key. For example, ``mautic.core.empty``.
95-
:param string|null $domain: Specific domain to search. Defaults to ``messages`` if ``NULL``.
96-
:param string|null $locale: Specific locale to search. Defaults to system or user configured locale.
94+
:param string $id: Translation key. For example, ``mautic.core.empty``.
95+
:param string|null $domain: Specific domain to search. Defaults to ``messages`` if ``NULL``.
96+
:param string|null $locale: Specific locale to search. Defaults to system or user configured locale.
9797

98-
:returns: ``TRUE`` if the translation key exists. ``FALSE`` otherwise.
99-
:returntype: boolean
98+
:returns: ``TRUE`` if the translation key exists. ``FALSE`` otherwise.
99+
:returntype: boolean

0 commit comments

Comments
 (0)