import { action, observable,autorun} from 'mobx'

class I18n {
    constructor()
    {
        autorun(()=>{
            if(this.lang)
            window.sessionStorage.i18n = this.lang
            else 
            window.sessionStorage.i18n = ""
        })
    }
    @observable
    lang=''

    @observable
    hasCancel=false

    @observable
    langInit = false


    get prefix(){
        if(!this.langInit)
            return "/"
        return `/${this.lang}/`
    }

}


export default new I18n()