/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
setup/src/Magento/Setup/Module/I18n/Locale.php
48 строк
842 B
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 11:23
22 окт 2025, 11:23
6c2f6e6
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ namespace Magento\Setup\Module\I18n; /** * Locale */ class Locale { /** * Default system locale */ const DEFAULT_SYSTEM_LOCALE = 'en_US'; /** * Locale name * * @var string */ protected $_locale; /** * Locale construct * * @param string $locale * @throws \InvalidArgumentException */ public function __construct($locale) { if (!preg_match('/[a-z]{2}_[A-Z]{2}/', $locale)) { throw new \InvalidArgumentException('Target locale must match the following format: "aa_AA".'); } $this->_locale = $locale; } /** * Return locale string * * @return string */ public function __toString() { return $this->_locale; } }