Skip to content

Commit f365589

Browse files
committed
docs: Add description for command
1 parent 3faa1e9 commit f365589

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
@@ -327,3 +327,29 @@ Detailed information can be found by running the command:
327327
.. code-block:: console
328328
329329
php spark lang:find --help
330+
331+
.. _sync-translations-command:
332+
333+
Synchronization Translation Files via Command
334+
========================================
335+
336+
.. versionadded:: 4.6.0
337+
338+
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.
339+
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')``.
340+
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.
341+
342+
All you need to do is execute:
343+
344+
.. code-block:: console
345+
346+
// Specify the locale for new/updated translations
347+
php spark lang:sync --target ru
348+
349+
// or set the original locale
350+
php spark lang:sync --locale en --target ru
351+
352+
As a result, you will receive files with the transfer keys.
353+
If there were duplicate keys in the target locale, they are saved.
354+
355+
.. warning:: Non-matching keys in new translations are deleted!

0 commit comments

Comments
 (0)