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"...
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 ...
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-&...
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 ...
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.
...
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()->...
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:...
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 ...
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 ...
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);
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">
...
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 ...
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.
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-...
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->...
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, ...
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
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 ...
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 ...
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\...
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 ...
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 ...
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....
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/...
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:...
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 ...
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 ...
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(),
...
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.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
locale × 84magento2 × 46
language × 12
localisation × 10
magento-1.9 × 9
admin × 7
currency × 7
country-regions × 4
magento-1.7 × 3
magento-1 × 3
date × 3
static-content × 3
translate × 3
language-package × 3
magento-2.1 × 2
magento2.3 × 2
magento-1.8 × 2
module × 2
magento2.2 × 2
extensions × 2
multistore × 2
configuration × 2
email-templates × 2
magento-community × 2
cli × 2