2

我创建了翻译文件,在jsonlint对其进行了验证,确保翻译文件位于 /locales/translation-en.json。

我一直收到错误,

There is a typo in: locales/translation-en.json

我很难过......这是我拥有的翻译 json。

{
   "tab":{
      "legionella":"LEGIONELLA",
      "logbook":"LOGBOOK"
   },
   "representative":{
      "tag":"Representative: __rep__ — Phone: __phone__ — ",
      "email":"Click here to email your rep"
   },
   "portlet":{
      "contacts":{
         "title":"Contacts",
         "type":"Contact<br>Type",
         "name":"Contact<br>Name",
         "phone":"Phone<br>Number",
         "type_context_1":"Owner",
         "type_context_2":"Maintenance",
         "type_context_3":"Other"
      },
      "samples":{
         "title":"Legionella Samples",
         "sampleDate":"Sample<br>Date",
         "transmitForm":"Transmittal<br>Form",
         "certOfAnalysis":"Certificate<br>of Analysis",
         "concentration":"Concentration<br>(UFC/L)",
         "correctAction":"Corrective<br>Action",
         "range_context_1":"Interference",
         "range_context_2":"Less than 10,000 UFC/L",
         "range_context_3":"Between 10,000 to 1,000,000 UFC/L",
         "range_context_4":"Greater than 1,000,000 UFC/L"
      },
      "serviceReports":{
         "title":"Service Reports",
         "date":"Report<br>Date"
      },
      "maintenance":{
         "title":"Maintenance Programs",
         "popup":"Create New Maintenance Program",
         "type":"Program<br>Type",
         "date":"Effective<br>Date",
         "document":"Program<br>Document",
         "type_context_1":"Water Treatment",
         "type_context_2":"Mechanical",
         "type_context_3":"Schematic",
         "type_context_4":"O&M Manual",
         "popup_type":"Type",
         "popup_date":"Effective Date",
         "popup_document":"Document",
         "popup_save":"Save Maintenance Program"
      },
      "history":{
         "title":"System History",
         "popup":"Create New System History Entry",
         "date":"Event<br>Date",
         "type":"Event<br>Type",
         "details":"Event<br>Details",
         "type_context_1":"Breakage",
         "type_context_2":"Repair",
         "type_context_3":"Decontamination",
         "type_context_4":"Replacement"
      },
      "reminders":{
         "title":"Reminders",
         "date":"Date",
         "description":"Description"
      },
      "emails":{
         "title":"Emails",
         "date":"Date",
         "subject":"Subject",
         "recipient":"Recipient"
      }
   },
   "common":{
      "view":"View",
      "registryList":"Registry: ",
      "signout":"Sign Out"
   }
}
4

3 回答 3

0

由于当搜索“i18next 有一个错字”时,这个问题在 Google 中弹出很高,这就是你可以做的。

使用 JSON 验证工具。如果它无效,请更正您的错误并重试。

于 2015-03-02T20:32:43.943 回答
0

万一有人错过了明显的..

JSON 与 Javascipt 不同,需要引用密钥。

有效的 JSON:

 { "foo": "bar" }

无效的 JSON:

 { foo: "bar" }
于 2014-12-03T08:44:05.993 回答
0

所以,我发现了这个问题。我没有提供原始问题中所需的所有详细信息。我没有让大家知道的是 json 文件位于 Netsuite 中。Netsuite 不喜欢提供 .json 文件。当我将它转换为 .json.txt 时,一切都很好。谢谢!

于 2014-06-12T12:50:29.327 回答