forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: (60 commits) Fix typo in comment Move prefix and suffix default values to a new PR MAGETWO-68877: Issue magento#7988 Typo changed also added comments for each index, getters and setters. magento#9484 Revert "MAGETWO-69728: Fixes layered navigation options being cached using the wrong store id. magento#9873" MAGETWO-67500: setup:di:compile returns exit code 0 if errors are found magento#7780 Fix prefix, middle name and suffix were not prefilled in the checkout add middle name to checkout address html templates magento#8878 Using Command output as message which actually provides more information for debugging than just the path Handling CLI error as a failure when validating composer.json file MAGETWO-69805: Return array of blocks as items instead of array of arrays magento#9157 MAGETWO-69666: Return array of pages as items instead of array of arrays magento#9823 MAGETWO-69723: Email to a Friend feature magento#9824 MAGETWO-69539: PHP "soap" extension is not declared in composer.json but can be used by Magento modules MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-63054: [Catalog] MSRP field is not displayed for bundle products with fixed price MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories MAGETWO-67087: Saving category deletes url-rewrites for products in anchor categories ...
- Loading branch information
Showing
77 changed files
with
1,315 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Braintree\Model; | ||
|
||
use Magento\Framework\Locale\ResolverInterface; | ||
use Magento\Braintree\Gateway\Config\PayPal\Config; | ||
|
||
class LocaleResolver implements ResolverInterface | ||
{ | ||
/** | ||
* @var ResolverInterface | ||
*/ | ||
private $resolver; | ||
|
||
/** | ||
* @var Config | ||
*/ | ||
private $config; | ||
|
||
/** | ||
* @param ResolverInterface $resolver | ||
* @param Config $config | ||
*/ | ||
public function __construct(ResolverInterface $resolver, Config $config) | ||
{ | ||
$this->resolver = $resolver; | ||
$this->config = $config; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getDefaultLocalePath() | ||
{ | ||
return $this->resolver->getDefaultLocalePath(); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function setDefaultLocale($locale) | ||
{ | ||
return $this->resolver->setDefaultLocale($locale); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getDefaultLocale() | ||
{ | ||
return $this->resolver->getDefaultLocale(); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function setLocale($locale = null) | ||
{ | ||
return $this->resolver->setLocale($locale); | ||
} | ||
|
||
/** | ||
* Gets store's locale or the `en_US` locale if store's locale does not supported by PayPal. | ||
* | ||
* @return string | ||
*/ | ||
public function getLocale() | ||
{ | ||
$locale = $this->resolver->getLocale(); | ||
$allowedLocales = $this->config->getValue('supported_locales'); | ||
|
||
return strpos($allowedLocales, $locale) !== false ? $locale : 'en_US'; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function emulate($scopeId) | ||
{ | ||
return $this->resolver->emulate($scopeId); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function revert() | ||
{ | ||
return $this->resolver->revert(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.