Skip to content

Commit 624ba01

Browse files
committed
docs: Description using command
1 parent 03a81b6 commit 624ba01

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

‎user_guide_src/source/outgoing/localization.rst‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,42 @@ project:
254254
255255
The translated messages will be automatically picked
256256
up because the translations folders get mapped appropriately.
257+
258+
259+
Automatic Translation Search via Command
260+
========================================
261+
262+
.. versionadded:: 4.5.0
263+
264+
You can automatically find and update translation files in your **app/** folder. The command will search for the use of the ``lang()`` function, combine the current translation keys in **app/Language** by defining the locale ``defaultLocale`` from **Config/App**.
265+
After the operation, you need to translate the language keys yourself.
266+
The command is able to recognize nested keys normally ``File.array.nested.text``.
267+
Previously saved keys do not change.
268+
269+
.. code-block:: console
270+
271+
php spark lang:find
272+
273+
.. literalinclude:: localization/019.php
274+
275+
276+
.. note:: Command ignoring **app/Language/** path.
277+
278+
279+
Before updating, it is possible to preview the translations found by the command:
280+
281+
.. code-block:: console
282+
283+
php spark lang:find --verbose --show-new
284+
285+
For a more accurate search, specify the desired locale or directory to scan.
286+
287+
.. code-block:: console
288+
289+
php spark lang:find --dir Controllers/Translation --locale en --show-new
290+
291+
Detailed information can be found by running the command:
292+
293+
.. code-block:: console
294+
295+
php spark help lang:find

0 commit comments

Comments
 (0)