import { createI18n } from 'vue-i18n';
import zhcnLocale from 'element-plus/lib/locale/lang/zh-cn';
import enLocale from 'element-plus/lib/locale/lang/en';
import zhtwLocale from 'element-plus/lib/locale/lang/zh-tw';
import jpLocale from 'element-plus/lib/locale/lang/ja'
// import myLocale from 'element-plus/lib/locale/lang/ms';
import { store } from '/@/store/index';

import nextZhcn from '/@/i18n/lang/zh-cn';
import nextEn from '/@/i18n/lang/en';
import nextZhtw from '/@/i18n/lang/zh-tw';
import nextJp from '/@/i18n/lang/jp';
import nextMs from '/@/i18n/lang/ms';

import pagesHomeZhcn from '/@/i18n/pages/home/zh-cn';
import pagesHomeEn from '/@/i18n/pages/home/en';
import pagesHomeZhtw from '/@/i18n/pages/home/zh-tw';
import pagesHomeJp from '/@/i18n/pages/home/jp';
import pageHomeMs from '/@/i18n/pages/home/ms';

import pagesLoginZhcn from '/@/i18n/pages/login/zh-cn';
import pagesLoginEn from '/@/i18n/pages/login/en';
import pagesLoginZhtw from '/@/i18n/pages/login/zh-tw';
import pagesLoginJp from '/@/i18n/pages/login/jp';
import pagesLoginMs from '/@/i18n/pages/login/ms';


import pagesFormI18nZhcn from '/@/i18n/pages/formI18n/zh-cn';
import pagesFormI18nEn from './pages/formI18n/en';
import pagesFormI18nZhtw from '/@/i18n/pages/formI18n/zh-tw';
import pagesFormI18nJp from '/@/i18n/pages/formI18n/jp';
import pagesFormI18nMs from '/@/i18n/pages/formI18n/ms';

// 患者管理 - 已注释（文件已删除）
// import hemodiPatientsI18n from '/@/i18n/pages/PatientManage/HemodiPatients';
// import outComeRecordI18n from '/@/i18n/pages/PatientManage/outComeRecord';
// import medicalHistoryI18n from '/@/i18n/pages/PatientManage/medicalHistory';
// import physiqueCheckI18n from '/@/i18n/pages/PatientManage/physiqueCheck';
// import courseRecordI18n from '/@/i18n/pages/PatientManage/courseRecord';


// 患者排班 - 已注释（文件已删除）
// import schedulingI18n from '/@/i18n/pages/scheduling/index';

// 透析方案 - 已注释（文件已删除）
// import hemoMedSchemeI18n from '/@/i18n/pages/PatientManage/hemoMedScheme';
// 干体重 - 已注释（文件已删除）
// import dryWeightI18n from '/@/i18n/pages/PatientManage/dryWeight';
// 血管通路 - 已注释（文件已删除）
// import vascularAccessI18n from '/@/i18n/pages/PatientManage/vascularAccess';


// 质控 - 已注释（文件已删除）
// import monthlyStatisticsOfDialysisFrequencyForPatientsI18n from '/@/i18n/pages/qc/monthlyStatisticsOfDialysisFrequencyForPatients';
// 定义语言国际化内容
/**
 * 说明：
 * /src/i18n/lang 下的 ts 为框架的国际化内容
 * /src/i18n/pages 下的 ts 为各界面的国际化内容
 */
const messages = {
	[zhcnLocale.name]: {
		...zhcnLocale,
		message: {
			...nextZhcn,
			homePage: {
				...pagesHomeZhcn
			},
			loginPage: {
				...pagesLoginZhcn
			},
			formPage: {
				...pagesFormI18nZhcn
			},
		},
	},
	[enLocale.name]: {
		...enLocale,
		message: {
			...nextEn,
			homePage: {
				...pagesHomeEn,
			},
			loginPage: {
				...pagesLoginEn,
			},
			formPage: {
				...pagesFormI18nEn,
			},
		},
	},
	[zhtwLocale.name]: {
		...zhtwLocale,
		message: {
			...nextZhtw,
			homePage: {
				...pagesHomeZhtw,
			},
			loginPage: {
				...pagesLoginZhtw,
			},
			formPage: {
				...pagesFormI18nZhtw,
			},
		},
	},
	[jpLocale.name]: {
		...jpLocale,
		message: {
			...nextJp,
			homePage: {
				...pagesHomeJp,
			},
			loginPage: {
				...pagesLoginJp,
			},
			formPage: {
				...pagesFormI18nJp,
			},
		},
	},
	ms: {
		...enLocale,
		message: {
			...nextMs,
			homePage: {
				...pageHomeMs
			},
			formPage: {
				...pagesFormI18nMs
			},
			loginPage: {
				...pagesLoginMs
			},
		},
	}
};

// 导出语言国际化
export const i18n = createI18n({
	locale: store.state.themeConfig.themeConfig.globalI18n,
	fallbackLocale: zhcnLocale.name,
	messages,
});
