cancel
Showing results for 
Search instead for 
Did you mean: 

i18n lacks option to collect only frontend phrases

i18n lacks option to collect only frontend phrases

Feature request from kandrejevs, posted on GitHub Jul 05, 2016

We have developed store with 3 languages- sk_SK, hu_HU, cs_CZ. Problem is that 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

(1)
3 Comments
baldwin_pieter
Core Contributor

 Email me when someone replies

franckgarnier
M2 Certified

Hello,

 

Someone has find a solution ?

 

Because perform the collect-phrases only on frontend folder do not cover 100% of frontend translation key.

 

You need to keep in mind that some error message can be retrieve from code.

 

Thanks,

5cb494b150a1d
New Contributor

Any updates on this? The link to the gist is not working anymore.