获取 i18next 翻译器缺少密钥

Getting i18next translator Missing key

这是我第一次使用 i18next,我不知道如何让它工作。 (似乎 documentation 对我来说是不完整的) 这是我的 HTML 代码,带有 i18next

<html>   
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/i18next/4.0.0/i18next.min.js" ></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-i18next/1.1.0/jquery-i18next.min.js"></script>
    <script src="/i18nextXHRBackend.min.js"></script>   
  </head>

  <body>
      <div id="test">
        <a data-i18n="Hello"></a>
        <div data-i18n="World"></div>
      </div>

      <script>
        i18next
            .init({
                "debug": true,
                "lng": "en",
                "ns": [
                  "translation"
                ],
                "fallbackLng": false,
                "keySeparator": false,
                "nsSeparator": false,
                resources: {
                  "backend": {
                    "loadPath": "locales/{{lng}}/{{ns}}.json"
                  }
                }
              }, function(err, t) {
               jqueryI18next.init(i18next, $);
               $('#test').localize();
             });
      </script>
  </body>  
</html>

这是我的 JSON:

{ "Hello" : "Hello in english", "World" : "World in english" }

我的页面没有显示,在控制台我有这个

i18next::translator: missingKey en translation Hello

i18next::translator: missingKey en translation World 

我错过了什么吗?

如果您遗漏了,则表明您的 json 文件中的翻译根本没有加载。

应该有关于后端无法在控制台加载的警告。

确保:locales/en/translation.json 可访问 - 或相应地修改路径