קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
blockly > setLocale
הפונקציה setLocale()
מגדיר את הלוקאל (כלומר, הלוקאלים של messages/block-text/etc) ללוקאל הנתון.
האפשרות הזו לא שימושית/נחוצה כשטוענים תג סקריפט, כי ההודעות מוצמדות באופן אוטומטי לאובייקט Blockly.Msg. אך אנו מספקים אותו גם בהקשרים של תג סקריפט וגם בהקשרים שאינם של תגי סקריפט, כדי שה-tcompiler יוכל ליצור כראוי את קובצי ההגדרה של הסוג שלנו.
Signature:
setLocale: (locale: {
[key: string]: string;
}) => void
פרמטרים
פרמטר |
סוג |
תיאור |
שילוב של שפה ואזור |
{ [key: string]: string; } |
אובייקט שמגדיר את ההודעות של שפה מסוימת. |
החזרות:
ריק
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 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"]]