연구 설문조사: Blockly 사용 경험을 알려주세요
설문조사 시작
blockly > setLocale
setLocale() 함수
언어(예: 현지화된 메시지/블록 텍스트 등)를 지정된 언어로 설정합니다.
메시지는 Blockly.Msg 객체에 자동으로 연결되므로 스크립트 태그에서 로드할 때는 유용하지도 필요하지도 않습니다. 그러나 tscompiler가 유형 정의 파일을 제대로 만들 수 있도록 스크립트 태그와 비 스크립트 태그 컨텍스트 모두에 이를 제공합니다.
서명:
setLocale: (locale: {
[key: string]: string;
}) => void
매개변수
매개변수 |
유형 |
설명 |
locale |
{ [key: string]: string; } |
지정된 언어의 메시지를 정의하는 객체입니다. |
반환:
void
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-11-04(UTC)
[null,null,["최종 업데이트: 2024-11-04(UTC)"],[[["The `setLocale()` function sets the locale for Blockly, determining the language used for messages and block text."],["While automatically handled when Blockly is loaded via a script tag, `setLocale()` is crucial for non-script-tag loading and type definition generation."],["It accepts a single argument: an object containing key-value pairs representing the localized messages for the desired language."]]],[]]