mirror of
https://gitee.com/ShopeX/ECShopX
synced 2026-08-11 13:45:33 +08:00
update src/CompanysBundle/MultiLang/MultiLangItem.php.
Signed-off-by: 唐永川 <tangyongchuan@shopex.cn>
This commit is contained in:
@@ -19,6 +19,12 @@ namespace CompanysBundle\MultiLang;
|
||||
|
||||
class MultiLangItem
|
||||
{
|
||||
private const LEGACY_TABLE_LANGUAGE_SUFFIXES = [
|
||||
'zh-CN' => 'zhCN',
|
||||
'en-CN' => 'enCN',
|
||||
'ar-SA' => 'arSA',
|
||||
];
|
||||
|
||||
protected $lang;
|
||||
|
||||
// private $module = 'item';
|
||||
@@ -33,11 +39,16 @@ class MultiLangItem
|
||||
$moduleNew = 'outside_item';
|
||||
}
|
||||
$this->moduleNew = $moduleNew;
|
||||
$tableLang = str_replace('-','',$lang);
|
||||
$tableLang = strtolower($tableLang);
|
||||
$tableLang = $this->normalizeTableLanguage($lang);
|
||||
$this->table = $moduleNew."_multi_lang_mod_lang_$tableLang";
|
||||
}
|
||||
|
||||
private function normalizeTableLanguage(string $lang): string
|
||||
{
|
||||
return self::LEGACY_TABLE_LANGUAGE_SUFFIXES[$lang]
|
||||
?? strtolower(str_replace('-', '', $lang));
|
||||
}
|
||||
|
||||
//创建语言表
|
||||
public function createTable()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user