0
Follow
10
View

在changeLanguage后不能获得i18n值

sayuri88 注册会员
2022-11-21 12:03

您错过了资源中的命名空间级别:

let resources = {
  "en": {
   "translation": {
    "ActivateActivate": {
      "Login Now": "Login Now現在登入"
    }
   }
  },
  "zh-hk": {
   "translation": {
    "ActivateActivate": {
      "Login Now": "現在登入"
    }
   }
  }
}

,你还需要在t调用中使用正确的键路径:

i18n.t("ActivateActivate.Login Now")

About the Author

Question Info

Publish Time
2022-11-21 12:03
Update Time
2022-11-21 12:03