i18n:collect-phrases
from root collects over 8000 strings including ones from adminhtml. We want only to translate frontend strings and leave backend in en_US locale. This can be achieved by creating csv file for every single module running command only on view/frontend
directory. But that is time consuming.Proposition: Add option to i18n:collect-phrases
command, to exclude view/adminhtml
directories and xml files that contains translatable strings for backend.
Here I played around a bit and made a small script that scans through app/code, theme and vendor folders, searches for base or frontend directory in view directory, translates it and in the end creates 2 csv files for comparison. in my case only frontend phrases are 770 vs 10 000 all phrases.
https://gist.github.com/kandrejevs/72dcc1cfd9841e3a646ffe1c23c73801
Thank you for your submission.
We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.
Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).
We are closing this GitHub ticket and have moved your request to the new forum.
If anyone else is looking for an answer for that. n98-magerun has a directory parameter. With that you can choose the directory to scan.
$ n98-magerun2.phar i18n:collect-phrases --skip-config vendor/amasty -o lang/lang.csv
@kamorana: please don't spread incorrect information, magerun2 inherits the i18n:collect-phrases
command from bin/magento
and adds no new functionality on top. The optional directory
argument is also available in bin/magento i18n:collect-phrases
.