mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
23 lines
368 B
JavaScript
23 lines
368 B
JavaScript
import ZHCN from './zh-CN';
|
|
import ZHTW from './zh-TW';
|
|
import EN from './en';
|
|
import JP from './jp';
|
|
|
|
const i18nMap = {
|
|
zh: ZHCN,
|
|
'zh-CN': ZHCN,
|
|
'zh-TW': ZHTW,
|
|
en: EN,
|
|
jp: JP
|
|
};
|
|
|
|
export default class I18n {
|
|
constructor({ option }) {
|
|
this.language = i18nMap[option.language] || i18nMap.en;
|
|
}
|
|
|
|
get(key) {
|
|
return this.language[key] || key;
|
|
}
|
|
}
|