I am translating my Magento 2 website. I would like to keep English for the admin pages, but use another language for the storefront (i.e. the pages customers see). This should mean there will be far fewer phrases to translate, as the admin pages will remain in English.

I am using the Magento command-line tool to generate the translation dictionary:

magento i18n:collect-phrases -o "/var/www/html/magento2/tr_TR.csv" -m

This outputs phrases used on the entire site - i.e. storefront AND admin pages. I would like it to output only the phrases used on the storefront.

Does anyone know if this possible?

  • Do you have a custom theme installed? – Mukesh Mar 29 '16 at 9:18
  • Yes, I have created a custom theme. To create it I followed the instructions in the Magento 2 frontend developer guide: link – David Mar 29 '16 at 9:30
  • If you want to translate just the theme it is possible. – Mukesh Mar 29 '16 at 9:47
  • I'm using a lot of Magento's default modules, so I will need to translate the phrases used on those modules. I was hoping there would be a simple way to ask the i18n:collect-phrases command to just find the phrases that are used on the storefront. From the docs it looks like there isn't such an option. Maybe I could go through each module and run i18n:collect-phrases on its sub-directories, but don't run is on the 'view/adminhtml' sub-directory. I could then concatenate the csv files that are generated. Do you think that would work? – David Mar 29 '16 at 10:19
  • 1
    There is feature request for this on github github.com/magento/magento2/issues/3920 – Mukesh Mar 30 '16 at 18:58

This is a good question really, but in the current implementation of the i18n tool there is no option to generate a dictionary for the storefront strings only.

| improve this answer | |
  • This is the correct answer unfortunately (thanks Alex). I submitted a feature request to the Magento team, however it will not be implemented because of the difficulty identifying admin and storefront strings. You can see the details here: https://github.com/magento/magento2/issues/3920. Hopefully the language packs will be generated on Crowdin soon, which should solve the problem. – David May 19 '16 at 13:46

Have you looked at the docs? You might be able to use inline translation?


..or perhaps this is what you are looking for?


| improve this answer | |
  • 1
    Thank you for your answer. I would prefer to use the translation dictionary method if possible (as described here: link ). I am worried that if I use the inline translation method I could miss some phrases. For example, there could be some phrases that are only displayed to the user after they perform an action on the site, and I don't want to miss them in my translation... – David Mar 29 '16 at 10:27
  • Well that is a way better solution! :) – Mackelito Mar 29 '16 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.