コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >setLocale
setLocale() 関数
言語/地域(ローカライズされたメッセージやブロック テキストなど)を特定の言語/地域に設定します。
メッセージは自動的に Blockly.Msg オブジェクトに格納されるため、スクリプトタグから読み込む場合、これは有用ではありません。ただし、tscompiler で型定義ファイルを適切に作成できるように、スクリプトタグとスクリプト以外のタグの両方のコンテキストで渡します。
署名:
setLocale: (locale: {
[key: string]: string;
}) => void
パラメータ
パラメータ |
型 |
説明 |
locale |
{ [キー: 文字列]: 文字列;} |
特定の言語のメッセージを定義するオブジェクト。 |
戻り値:
void
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-25 UTC。"],[],["The `setLocale()` function sets the localized messages for Blockly. It accepts a `locale` object where keys are strings and values are the corresponding translated messages. This function is primarily used in non-script-tag contexts for setting custom locales. While it's not necessary when using a script tag, it's included for type definition purposes in the TypeScript compiler. The function takes the locale object as the only parameter and doesn't return any value.\n"]]