import zh from "./zh"
import en from "./en"
import { getset } from '@/api';
import { geti18n } from '@/utils/i18n';
import store from '@/store';
import { getValue } from '@/utils/common';
getset().then((res: any)=>{
    zh.shichangtishi = `最短${res.timeLowerLimit}min, 最长${res.timeCeiling}min`
    en.shichangtishi = `The shortest is ${res.timeLowerLimit}min and the longest is ${res.timeCeiling}min`
    zh.renshutishi = `最少${res.lowerLimit}人, 最多${res.numberCeiling}人`
    en.renshutishi = `At least ${res.lowerLimit}, at most ${res.numberCeiling}`
    // en.shichangtishi = `Minimum ${res.lowerLimit} person, maximum ${res.numberCeiling} people`
    zh.tixianzhu = `注：每笔提现收取${res.sxf}服务费，最低${ res.symbol + res.minmoney }`
    en.tixianzhu = `Note: ${res.sxf} service fee will be charged for each withdrawal, with a minimum of ${ res.symbol + res.minmoney }`
    zh.zuiditixian = "最低提现金额" + res.symbol + res.minwithdraw
    en.zuiditixian = "Minimum withdrawal amount " + res.symbol + res.minwithdraw
    zh.zhibotishi = `直播资格按照上周浏览量排名，前${res.views}名具备直播资格。`
    en.zhibotishi = `According to the ranking of views last week, the top ${res.views} are eligible for live streaming`
    zh.zhiboshijian = `提示您只能发布 ${res.releaseLiveDay} 天以内的直播课`
    en.zhiboshijian = `You can only post live classes for ${res.releaseLiveDay} days!`
    const i18n = geti18n();
    const loc = i18n.locale.value;
    i18n.locale.value = '';
    i18n.locale.value = loc;
    console.log('i18n')
    store.commit("setseting", res)
})

export default {
    locale: getValue("Lanvuage") || 'zh', //默认语言
    messages: {
        zh: zh,
        en: en
    }
}