Skip to content

Commit 0ba5bc8

Browse files
committed
docs: Add description for command
1 parent 07e6321 commit 0ba5bc8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

user_guide_src/source/outgoing/localization.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,29 @@ Detailed information can be found by running the command:
366366
.. code-block:: console
367367
368368
php spark lang:find --help
369+
370+
.. _sync-translations-command:
371+
372+
Synchronization Translation Files via Command
373+
========================================
374+
375+
.. versionadded:: 4.6.0
376+
377+
After working on your translation for the current language for a long time, in some cases you will need to create files for another language.
378+
The ``spark lang:find`` command can be used, it is not prohibited. But it cannot fully detect absolutely all translations. Especially if the parameters are dynamically set as ``lang('App.status.' . $key, ['payload' => 'John'], 'en')``.
379+
In this case, the best solution is to copy the finished language files and translate them. This way you can save your unique keys that the command did not find.
380+
381+
All you need to do is execute:
382+
383+
.. code-block:: console
384+
385+
// Specify the locale for new/updated translations
386+
php spark lang:sync --target ru
387+
388+
// or set the original locale
389+
php spark lang:sync --locale en --target ru
390+
391+
As a result, you will receive files with the transfer keys.
392+
If there were duplicate keys in the target locale, they are saved.
393+
394+
.. warning:: Non-matching keys in new translations are deleted!

0 commit comments

Comments
 (0)