গবেষণা সমীক্ষা: ব্লকলি
স্টার্ট সার্ভে নিয়ে আপনার অভিজ্ঞতা সম্পর্কে আমাদের বলুন
লেবেল ক্ষেত্র
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
একটি লেবেল ক্ষেত্র একটি স্ট্রিংকে এর value
হিসাবে এবং একটি স্ট্রিং এর text
হিসাবে সংরক্ষণ করে। একটি লেবেল ক্ষেত্রের value
এবং text
সবসময় একই থাকে।
লেবেল ক্ষেত্র

ভেঙে পড়া ব্লকে লেবেল ক্ষেত্র

সৃষ্টি
JSON
{
"type": "example_label",
"message0": "a label %1 and another label",
"args0": [
{
"type": "input_dummy"
}
]
}
ইন্টারপোলেশন আর্গুমেন্টের মধ্যে যেকোনো বার্তা পাঠ্য লেবেল স্ট্রিং হয়ে যায়। বিকল্পভাবে, লেবেলগুলি স্পষ্টভাবে অন্তর্নিহিত হতে পারে, হয় একটি বস্তু বা পাঠ্য হিসাবে। এটি সাধারণত নিরুৎসাহিত করা হয় কারণ এটি অনুবাদকে আরও কঠিন করে তোলে।
{
"type": "example_label",
"message0": "%1 %2 %3",
"args0": [
{
"type": "field_label",
"text": "a label"
},
{
"type": "input_dummy"
},
"and another label"
]
}
জাভাস্ক্রিপ্ট
Blockly.Blocks['example_label'] = {
init: function() {
this.appendDummyInput()
.appendField(new Blockly.FieldLabel('a label'));
this.appendDummyInput()
.appendField('and another label');
}
};
appendField ফাংশন FieldLabel
অবজেক্ট এবং আরও সাধারণভাবে, লেবেল তৈরি করতে স্ট্রিং উভয়ই গ্রহণ করে।
লেবেল ক্ষেত্রটি একটি ঐচ্ছিক মান এবং একটি ঐচ্ছিক CSS ক্লাস স্ট্রিং নেয়। একটি খালি স্ট্রিং উভয় ডিফল্ট.
সিরিয়ালাইজেশন
লেবেল ক্ষেত্রগুলি ক্রমিক নয়।
আপনি যদি আপনার লেবেলটিকে সিরিয়ালাইজ করতে চান, কারণ এটি প্রোগ্রাম্যাটিকভাবে পরিবর্তিত হচ্ছে, সিরিয়ালাইজেবল লেবেল ক্ষেত্রটি দেখুন।
যাচাইকারী
লেবেল ক্ষেত্রগুলি যাচাইকারীদের সমর্থন করে না, কারণ সেগুলি সম্পাদনাযোগ্য নয়৷
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eA label field displays text on a block and stores the same string as both its \u003ccode\u003evalue\u003c/code\u003e and \u003ccode\u003etext\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eLabel fields can be created using JSON by specifying message strings or by explicitly interpolating labels, though the latter is discouraged for translation reasons.\u003c/p\u003e\n"],["\u003cp\u003eIn JavaScript, label fields are created using \u003ccode\u003eBlockly.FieldLabel\u003c/code\u003e and appended to block inputs using \u003ccode\u003eappendField\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWhile not serializable by default, a separate "Serializable Label" field exists for cases requiring programmatic changes and serialization.\u003c/p\u003e\n"],["\u003cp\u003eLabel fields do not support validators due to their non-editable nature.\u003c/p\u003e\n"]]],[],null,["# Label fields\n\nA label field stores a string as its `value` and a string as its `text`. The\n`value` and `text` of a label field are always the same.\n\n#### Label field\n\n#### Label field on collapsed block\n\nCreation\n--------\n\n### JSON\n\n {\n \"type\": \"example_label\",\n \"message0\": \"a label %1 and another label\",\n \"args0\": [\n {\n \"type\": \"input_dummy\"\n }\n ]\n }\n\nAny message text between interpolation arguments becomes label strings.\nAlternatively, labels may be interpolated explicitly, either as an object or\nas text. This is generally discouraged as it makes translation more\ndifficult. \n\n {\n \"type\": \"example_label\",\n \"message0\": \"%1 %2 %3\",\n \"args0\": [\n {\n \"type\": \"field_label\",\n \"text\": \"a label\"\n },\n {\n \"type\": \"input_dummy\"\n },\n \"and another label\"\n ]\n }\n\n### JavaScript\n\n Blockly.Blocks['example_label'] = {\n init: function() {\n this.appendDummyInput()\n .appendField(new Blockly.FieldLabel('a label'));\n this.appendDummyInput()\n .appendField('and another label');\n }\n };\n\nThe [appendField](/blockly/reference/js/Blockly.Input#appendField)\nfunction accepts both `FieldLabel` objects and, more commonly, strings to create\nlabels.\n\nThe label field takes in an optional value, and an optional css class string.\nBoth default to an empty string.\n\nSerialization\n-------------\n\nLabel fields are not serializable.\n\nIf you would like your label to be serialized, because it is being changed\nprogrammatically, see the [Serializable Label](/blockly/guides/create-custom-blocks/fields/built-in-fields/label-serializable)\nfield.\n\nValidators\n----------\n\nLabel fields do not support validators, because they are not editable."]]