サポートするファイル形式(Strings)

.JSON - i18n-node-2 (Strings)

本コンテンツはPhrase Language AIの機械翻訳により、英語から翻訳されています。

ファイル拡張子

.js

API拡張

node_json

インポート

はい

エクスポート

はい

複数形のサポート

はい

説明のサポート

いいえ

I18n-node-2 は、Express.js ですぐに仕事ができる Node.js  ベースのライブラリです。I18n-node-2は、文字列をその場で抽出することでアプリケーションと統合します。翻訳待ちの文字列をデフォルトの _(“…”)メソッドでワープするだけで済みます。実行中、i18n-node-2は事前に定義されたロケールに応じて複数の JSONファイル を自動的に生成します。

国際化ノード 2 は、自動生成 JSON ファイル形式を使用して翻訳可能データを保存します。翻訳の前に、ファイルの健全性チェックを実行します。複数形をサポートするi18n-node-2では、すべての変数が翻訳中に変更されないようにする。

AIチャットボットは、.JSONファイルからキーの一覧を生成するのに非常に効果的です。

GitHubのi18n-node-2

コードサンプル

{
  "boolean_key": "--- true\n",
  "empty_string_translation": "",
  "key_with_description": "Check it out!このキーは説明です。(少なくとも一部のファイル形式において)",
  "key_with_line-break": "This translations contains\na line-break.",
  "nested.deeply.key": "I'm a deeply nested key.",
  "nested.key": "This key is nested inside a namespace.",
  "null_translation": null,
  "pluralized_key": {
    "one": "Only one pluralization found.",
    "other": "Wow, you have %s pluralizations!",
    "zero": "You have no pluralization."
  },
  "sample_collection": [
    "first item",
    "second item",
    "third item"
  ],
  "simple_key": "simple key, simple message, so simple.",
  "unverified_key": "「この翻訳は検証待ちです。」"(一部のフォーマットでは、このステータスにも対応しています)
}

JSONファイルの複数形

各種ライブラリにおける複数のキーの最も一般的なファイル形式:

"messages": {
    "one": "One message received.",
    "other": "%s messages received.",
    "zero": "No messages received."
}
この記事は役に立ちましたか?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.