Magento – How to set the locale (en_US”) of Magento2 (I/F Locale) by using command line

clicommand linelocalemagento2

I have installed magento 2.0.7 with CentoOS 7 / Apache 2.4.6 / PHP 7 / MariaDB 10. After applying the Japanese locale to "Interface Locale" under Account Setting (refer the link below), I get "HTTP ERROR 500" for accessing the admin console.

Link: Magento 2 – How do I change the locale of admin backend?

Found that the Japanese locale installation was incomplete. Consequently, I need a help for restoring the "en_US" locale by updating DB or Coding.

Please help me to resolve this issue by providing the steps to change the locale with using command line.
Many thanks in advance.

Best Answer

First you need to find out the language code by using

php bin/magento info:language:list

Once you've found the language code you can set the language by calling

php bin/magento setup:store-config:set --language=code

UPD for v2.2

magento config:set general/locale/code ${LOCALE}

or:

magento config:set general/locale/code ${LOCALE} --scope=store --scope-code=${STORE_CODE}
Related Topic