Skip to content

Commit e120bbb

Browse files
authored
feat: add Bengali (bn) language support (#5426)
* translation: localize core UI strings for Bengali locale Update several core UI strings in the Bengali translation file (bn.json). It translates essential labels such as 'Music Blocks Project', 'Refresh browser', and 'Action' to improve the experience for Bengali-speaking users. * Fix: add localized tooltips for Close and Minimize buttons * docs: separate UI logic from translation strings * docs: update master translation file bn.po * Add Bengali (bn) language support to UI and locales * style: fix formatting with prettier * test: update expected translation call counts for Bengali * chore: re-run CI checks * style: format files to comply with Prettier v6
1 parent 4d29af1 commit e120bbb

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,10 @@
474474
<li><a id="te"></a></li>
475475
<li><a id="ibo"></a></li>
476476
<li><a id="ar"></a></li>
477+
<li><a id="bn"></a></li>
477478
<li><a id="he"></a></li>
478479
<li><a id="ur"></a></li>
480+
479481
</ul>
480482

481483
<ul style="display: none;" id="themedropdown" class="dropdown-content">

js/__tests__/toolbar.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ describe("Toolbar Class", () => {
9595
test("sets correct strings for _THIS_IS_MUSIC_BLOCKS_ true", () => {
9696
global._THIS_IS_MUSIC_BLOCKS_ = true;
9797
toolbar.init({});
98-
expect(global._).toHaveBeenCalledTimes(134);
98+
expect(global._).toHaveBeenCalledTimes(135);
9999
expect(global._).toHaveBeenNthCalledWith(1, "About Music Blocks");
100100
});
101101

102102
test("sets correct strings for _THIS_IS_MUSIC_BLOCKS_ false", () => {
103103
global._THIS_IS_MUSIC_BLOCKS_ = false;
104104
toolbar.init({});
105-
expect(global._).toHaveBeenCalledTimes(116);
105+
expect(global._).toHaveBeenCalledTimes(117);
106106
expect(global._).toHaveBeenNthCalledWith(1, "About Turtle Blocks");
107107
});
108108

js/languagebox.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,15 @@ class LanguageBox {
176176
this.hide();
177177
}
178178

179+
/**
180+
* @public
181+
* @returns {void}
182+
*/
183+
bn_onclick() {
184+
this._language = "bn";
185+
this.hide();
186+
}
187+
179188
/**
180189
* @public
181190
* @returns {void}
@@ -235,6 +244,7 @@ class LanguageBox {
235244
he: "רענן את הדפדפן כדי לשנות את העדפת השפה שלך.",
236245
ayc: "Actualice su navegador para cambiar su preferencia de idioma.",
237246
quz: "Actualice su navegador para cambiar su preferencia de idioma.",
247+
bn: "ভাষা পরিবর্তন করতে আপনার ব্রাউজার রিফ্রেশ করুন।",
238248
gug: "Actualice su navegador para cambiar su preferencia de idioma.",
239249
ur: "اپنی زبان کی ترجیح کو تبدیل کرنے کے لئے اپنے براؤزر کو تازہ دم کریں۔"
240250
};

js/toolbar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class Toolbar {
107107
["ibo", _("igbo"), "innerHTML"],
108108
["ar", _("عربى"), "innerHTML"],
109109
["te", _("తెలుగు"), "innerHTML"],
110+
["bn", _("বাংলা"), "innerHTML"],
110111
["he", _("עִברִית"), "innerHTML"],
111112
["ur", _("اردو"), "innerHTML"]
112113
];
@@ -242,6 +243,7 @@ class Toolbar {
242243
["ibo", _("igbo"), "innerHTML"],
243244
["ar", _("عربى"), "innerHTML"],
244245
["te", _("తెలుగు"), "innerHTML"],
246+
["bn", _("বাংলা"), "innerHTML"],
245247
["he", _("עִברִית"), "innerHTML"],
246248
["ur", _("اردو"), "innerHTML"]
247249
];
@@ -1171,6 +1173,7 @@ class Toolbar {
11711173
"ibo",
11721174
"ar",
11731175
"te",
1176+
"bn",
11741177
"he",
11751178
"ur"
11761179
];

0 commit comments

Comments
 (0)