Skip to main content
18 votes
Accepted

How to change currency format in Magento 2?

create just simple module and overrider default *Format.php** file, app/code/Package/Modulename/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
Rakesh Jesadiya's user avatar
9 votes
Accepted

Magento 2 : How to install new language pack

I have done by just using below command for it composer require splendidinternet/mage2-locale-de-de php bin/magento setup:upgrade php bin/magento setup:static-content:deploy de_DE Note : commands ...
Suresh Chikani's user avatar
7 votes
Accepted

Magento 2: How can I get de locale code?

$storeId = $this->_storeManager->getStore()->getId(); /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, */ $localeCode = $this->scopeConfig-&...
Mohammad Mujassam's user avatar
5 votes
Accepted

Magento 2 Country Name not get translated when using countryFactory

Use locale code as param in getName <?php public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory ) { $this->countryFactory = $countryFactory; } public ...
Ranganathan's user avatar
  • 3,240
5 votes

How to change currency format in Magento 2?

By default of Magento 2, price format is a little strange for some currencies so we need to change it. Here’s the way to change price format. Here’s the example for the case of Vietnamese dong. ...
Aasim Goriya's user avatar
  • 5,454
5 votes

Why are emails being sent from the wrong store from the command line

The problem is that the Mage::getModel('core/email_template') loads the design information using Mage_Core_Model_Template::_applyDesignConfig() which intern loads a store via Mage::getDesign()->...
David Manners's user avatar
4 votes

Magento 2 : How to install new language pack

Package link To install it: extract and copy into /app/i18n/splendid/de_DE/ Remove pub/static/* Run Command using CLI: php bin/magento setup:static-content:deploy de_DE php bin/magento setup:...
Ronak Chauhan's user avatar
3 votes
Accepted

Allowed Countries

Yes, tht settings "Allowed Countries" allows you to restrict the purchase of products on your site only to those allowed countries. If New Zealand is the only country allowed, then someone who is ...
Jeff Finkelstein's user avatar
3 votes
Accepted

Setup:static-content:deploy issue with locale

Make sure you've selected English (United States) in your locale settings: Stores > Configuration > General > Locale Options setup:static-content:deploy by default deploys en_US If you'd ...
AJK's user avatar
  • 751
3 votes

How to get country name from country code?

In order to get the country name in English locale: $locale = new Zend_Locale('en_US'); echo $locale->getTranslation($code, 'country', $locale);
MagePsycho's user avatar
  • 4,650
3 votes

How to change currency format in Magento 2?

Go from your root folder to vendor/magento/zendframework1/library/Zend/Locale/Data/es_MX.xml Look for <currencyFormat You can set the format like this : <currencyFormat type="standard"> ...
Ashish Jagnani's user avatar
2 votes
Accepted

Check locale of current website Magento 2

You can use \Magento\Store\Api\Data\StoreInterface to get locale code Inject this class in your constructor /**@var \Magento\Store\Api\Data\StoreInterface **/ protected $_store; public function ...
Khoa TruongDinh's user avatar
2 votes

Fatal error: Class 'Locale' not found magento 2.0.2

The sollution I found was to run xampp's shell and there write the code. Otherwise, on command prompt ( Windows ) it would give me the same error.
user3927840's user avatar
2 votes

How to change currency format in Magento 2?

to change or remove decimals for different currencies, you just need to install the free module Currency Formatter Extension from Mageplaza here the link: https://www.mageplaza.com/magento-2-currency-...
sotmlac's user avatar
  • 45
2 votes
Accepted

Magento 2 set locale in CLI command module

Ok following Raphael suggestions I found how to set locale and enable traslations in a command CLI module: /** @var Magento\Framework\TranslateInterface */ $localeInterface = $this->...
floyd's user avatar
  • 51
2 votes

Setup:static-content:deploy issue with locale

You have to set the right language for your website admin > Stores > Configuration > Locale, if you inspect the dropdown options, you will see all the code_ISO and the language name, ...
PЯINCƎ's user avatar
  • 11.7k
2 votes
Accepted

Magento 2 Interface Locale issue with en_gb(uk)

You could try this module. I've written this some time ago, but it should help or just give you hints how to solve it https://github.com/mmularski/magento2-locale-date-time
Marek Mularczyk's user avatar
1 vote
Accepted

Where window.LOCALE is set in Magento 2 code

The window.LOCALE value is set by Magento's JavaScript initialization script located in pub/static/frontend/[Vendor]/[theme]//requirejs-config.js. When Magento initializes the JavaScript on a page, it ...
Dotsquares's user avatar
1 vote

Magento 2.4: How to add the locale for a website using config.php?

On your local environment set the wanted locale. Then run bin/magento app:config:dump. This will dump all your config in your config.php. Then you can see how your locale is going to be set in the ...
Carlo Ricci's user avatar
1 vote
Accepted

Timezone and locale dropdown in custom form frontend

You can get your result by following code: <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?> <?php $localeLists = $objectManager->create('Magento\Framework\...
Sukumar Gorai's user avatar
1 vote

Add custom locale to the allowed locale list variable in Magento\Framework\Locale\Config

Doesn't feel quite right offering this as an answer, as it violates every rule in the book about not touching core code (well not every rule). I have figured it out I think (please excuse errors, but ...
cygnus digital's user avatar
1 vote

Resolver does not report correct locale

I simply use the following to get the store locale protected $_store; public function __construct( ... \Magento\Store\Api\Data\StoreInterface $store ) { $this->_store = $store; } and ...
Dava Gordon's user avatar
  • 1,618
1 vote
Accepted

Very slow loading upon locale change

You need deploy your language to run below command php bin/magento setup:upgrade php bin/magento setup:static-content:deploy ru_RU en_US php bin/magento cache:clean Let me know if you have any issue....
Suresh Chikani's user avatar
1 vote

How can magento2 support .less or css for multi language locale?

Simple ways to customize a theme's styles for magento2 Simplest way to extend parent styles To extend the parent theme’s styles in your theme: In your theme directory, create a web/css/...
situee's user avatar
  • 111
1 vote

How can magento2 support .less or css for multi language locale?

You can add new CSS to the head of all your template pages. Create /Magento_Theme/layout/default_head_blocks.xml: <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
karthick's user avatar
  • 675
1 vote

Magento 2 set locale in CLI command module

I'm pretty sure setting the locale of Magento\Framework\Locale\ResolverInterface is not enough as this is only for the locale resolver. I reckon you also need to to set the locale interface locale by ...
Raphael at Digital Pianism's user avatar
1 vote

Check locale of current website Magento 2

Best way is to use the locale resolver (Magento\Framework\Locale\ResolverInterface::getLocale()): /** * @var \Magento\Framework\Locale\ResolverInterface */ protected $localeResolver; /** * @param ...
Giel Berkers's user avatar
  • 12.3k
1 vote

How to change currency format in Magento 2?

Bad way to do it (but faster) is hardcoding vendor/magento/framework/Locale/Format.php $result = [ //TODO: change interface 'pattern' => $currency->getOutputFormat(), ...
alex davila's user avatar
1 vote

Magento 2: Different static-content Files Per Locale?

Instead of complete separate file for different language, you can extend the theme by overriding the default files. Either in extends.less or theme.less file. Below can be the structure to override. ...
H.Husain's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible