|
282 | 282 | } |
283 | 283 | ] |
284 | 284 | }, |
| 285 | + { |
| 286 | + "title": "ফ্লাটার লোকালাইজেশন (Flutter Internationalization)", |
| 287 | + "items": [ |
| 288 | + { |
| 289 | + "definition": "লোকালাইজেশন কি?", |
| 290 | + "code": "লোকালাইজেশন হলো একটি অ্যাপে ভিন্ন ভিন্ন ভাষার অনুবাদ রাখা। যার মাধ্যমে ইউজার তাঁর পছন্দ মতো ভাষায় অ্যাপটি ব্যবহার করতে পারে।" |
| 291 | + }, |
| 292 | + { |
| 293 | + "definition": "প্রথমেই প্রয়োজনীয় ডিপেন্ডেন্সি যোগ করতে হবে", |
| 294 | + "code": "dependencies:\n flutter_localizations: ^0.2.2\n intl: ^0.19.0" |
| 295 | + }, |
| 296 | + { |
| 297 | + "definition": "pubspec.yaml এ generate ফ্ল্যাগ যোগ করুন", |
| 298 | + "code": "flutter:\n generate: true" |
| 299 | + }, |
| 300 | + { |
| 301 | + "definition": "l10n.yaml ফাইল তৈরি করুন", |
| 302 | + "code": "arb-dir: lib/l10n\ntemplate-arb-file: app_en.arb\noutput-localization-file: app_localizations.dart" |
| 303 | + }, |
| 304 | + { |
| 305 | + "definition": "ARB ফাইল তৈরি করুন (lib/l10n/app_en.arb)", |
| 306 | + "code": "{\n \"helloWorld\": \"Hello World!\",\n \"@helloWorld\": {\n \"description\": \"The conventional newborn programmer greeting\"\n }\n}" |
| 307 | + }, |
| 308 | + { |
| 309 | + "definition": "MaterialApp এ লোকালাইজেশন ডেলিগেট যোগ করুন", |
| 310 | + "code": "import 'package:flutter_localizations/flutter_localizations.dart';\nimport 'package:flutter_gen/gen_l10n/app_localizations.dart';\n\nMaterialApp(\n localizationsDelegates: [\n AppLocalizations.delegate,\n GlobalMaterialLocalizations.delegate,\n GlobalWidgetsLocalizations.delegate,\n GlobalCupertinoLocalizations.delegate,\n ],\n supportedLocales: [\n Locale('en', ''), // English\n Locale('bn', ''), // Bengali\n ],\n)" |
| 311 | + }, |
| 312 | + { |
| 313 | + "definition": "Ui তে টেক্সট ব্যবহার করতে -", |
| 314 | + "code": "Text(AppLocalizations.of(context)!.helloWorld)" |
| 315 | + }, |
| 316 | + { |
| 317 | + "definition": "প্যারামিটার সহ অনুবাদ করতে -", |
| 318 | + "code": "// In ARB file:\n{\n \"greetingMessage\": \"Hello {name}\",\n \"@greetingMessage\": {\n \"placeholders\": {\n \"name\": {\n \"type\": \"String\",\n \"example\": \"Bob\"\n }\n }\n }\n}\n\n// In Dart code:\nText(AppLocalizations.of(context)!.greetingMessage('Alice'))" |
| 319 | + }, |
| 320 | + { |
| 321 | + "definition": "বর্তমান ভাষা পরিবর্তন করতে -", |
| 322 | + "code": "Locale newLocale = Locale('bn', '');\nFlutterI18n.refresh(context, newLocale);" |
| 323 | + }, |
| 324 | + { |
| 325 | + "definition": "ডিভাইসের ডিফল্ট লোকেল পেতে -", |
| 326 | + "code": "Locale myLocale = Localizations.localeOf(context);" |
| 327 | + }, |
| 328 | + { |
| 329 | + "definition": "অনুবাদ জেনারেট করতে টার্মিনালে রান করুন -", |
| 330 | + "code": "flutter gen-l10n" |
| 331 | + } |
| 332 | + ] |
| 333 | + }, |
285 | 334 | { |
286 | 335 | "title": "কিছু ইম্পরট্যান্ট ফ্লাটার শীট", |
287 | 336 | "items": [ |
|
0 commit comments