@@ -77,6 +77,7 @@ placeholder ``{locale}`` can be placed as a segment in your route. If present, t
7777segment will be your locale:
7878
7979.. literalinclude :: localization/004.php
80+ :lines: 2-
8081
8182In this example, if the user tried to visit **http://example.com/fr/books **, then the locale would be
8283set to ``fr ``, assuming it was configured as a valid locale.
@@ -86,6 +87,7 @@ locale will be used in it's place, unless you set to use only the supported loca
8687file:
8788
8889.. literalinclude :: localization/018.php
90+ :lines: 2-
8991
9092.. note :: The ``useSupportedLocalesOnly()`` method can be used since v4.3.0.
9193
@@ -137,6 +139,7 @@ If your controller is extending ``CodeIgniter\Controller``, this will be availab
137139Alternatively, you can use the :doc: `Services class </concepts/services >` to retrieve the current request:
138140
139141.. literalinclude :: localization/006.php
142+ :lines: 2-
140143
141144.. _language-localization :
142145
@@ -185,10 +188,12 @@ For example, to load the ``errorEmailMissing`` string from the **Errors.php**
185188language file, you would do the following:
186189
187190.. literalinclude :: localization/010.php
191+ :lines: 2-
188192
189193For nested definition, you would do the following:
190194
191195.. literalinclude :: localization/011.php
196+ :lines: 2-
192197
193198If the requested language key doesn't exist in the file for the current locale (after `Language Fallback `_), the string will be passed
194199back, unchanged. In this example, it would return ``Errors.errorEmailMissing `` or ``Errors.nested.error.message `` if it didn't exist.
@@ -208,10 +213,12 @@ You can pass an array of values to replace placeholders in the language string a
208213The first item in the placeholder corresponds to the index of the item in the array, if it's numerical:
209214
210215.. literalinclude :: localization/013.php
216+ :lines: 2-
211217
212218You can also use named keys to make it easier to keep things straight, if you'd like:
213219
214220.. literalinclude :: localization/014.php
221+ :lines: 2-
215222
216223Obviously, you can do more than just number replacement. According to the
217224`official ICU docs <https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classMessageFormat.html#details >`_ for the underlying
0 commit comments