Bangla and English website localization has four parts: translatable interface strings, translated content, locale-aware formatting of numbers and dates, and a font setup that renders Bangla script correctly. On WordPress that means gettext functions with .po and .mo files plus a multilingual plugin for content; in JavaScript apps it means an i18n library with JSON message files. This guide covers both, with the bn_BD and bn-BD details, Bangla digits and lakh grouping, hreflang and a simple way to find strings that are still in English.

From my own work: On the Bangla sites I work on, the translated text is rarely the problem. The problems are the bits nobody listed: button labels hard-coded in a theme, prices formatted in Latin digits in one place and Bangla digits in another, and a font that renders conjuncts as broken boxes on some Android phones.
Locale codes for a Bangla and English site
Each layer of the stack has its own spelling for the same language:
- WordPress:
bn_BDfor Bangla (Bangladesh),en_USoren_GBfor English, with an underscore. - HTML:
<html lang="bn">orlang="bn-BD", with a hyphen. WordPress outputs this throughlanguage_attributes()in the theme. - hreflang:
bnorbn-BDanden. Add the region only if you really target that country. - JavaScript Intl:
bn-BD, which also decides digits and grouping.
Pick a URL structure before you translate anything. A subdirectory such as /bn/ keeps one domain, one hosting setup and one Search Console property, and suits most small and medium sites.
WordPress: make strings translatable with gettext
Themes and plugins wrap every visible string in a gettext function with a text domain that matches the plugin or theme slug (How to internationalize your plugin):
<?php
// plain and escaped strings
esc_html_e( 'Add to cart', 'my-shop' );
echo esc_html__( 'Free delivery in Dhaka', 'my-shop' );
// placeholders: never concatenate translated fragments
/* translators: %s: customer first name */
printf( esc_html__( 'Welcome back, %s', 'my-shop' ), esc_html( $name ) );
// plurals and context
printf( esc_html( _n( '%s item', '%s items', $count, 'my-shop' ) ), number_format_i18n( $count ) );
echo esc_html_x( 'Post', 'verb: publish a post', 'my-shop' );
Whole sentences with placeholders matter more in Bangla than in many languages, because word order differs from English; a sentence built from three translated pieces usually reads wrong. Since WordPress 6.7, calling translation functions before the init hook triggers a _load_textdomain_just_in_time was called incorrectly notice, so do not translate strings at file load time or in constants.
For JavaScript inside WordPress, use wp.i18n.__() from the wp-i18n script and call wp_set_script_translations( 'my-shop-script', 'my-shop', plugin_dir_path( __FILE__ ) . 'languages' ) after registering the script.
Generate and compile the translation files
# 1. extract strings into a template
wp i18n make-pot . languages/my-shop.pot --domain=my-shop
# 2. start a Bangla translation (first time only)
msginit --no-translator --locale=bn_BD --input=languages/my-shop.pot --output=languages/my-shop-bn_BD.po
# 3. later: merge new strings into the existing .po
wp i18n update-po languages/my-shop.pot languages/
# 4. after translating: compile for PHP and JavaScript
wp i18n make-mo languages/
wp i18n make-php languages/
wp i18n make-json languages/ --no-purge
make-php creates .l10n.php files, which WordPress 6.5 and later load faster than .mo files; keep the .mo as well for older versions and tools. The Bangla plural rule is the same shape as English, nplurals=2; plural=(n != 1);, which msginit fills in for you. Translate the .po in Poedit or any editor that understands gettext.
Strings versus content: Loco Translate, Polylang and WPML
WordPress sites have two kinds of text, and they need different tools:
- Interface strings from themes and plugins, such as buttons, labels and emails. Loco Translate edits these
.pofiles from the dashboard. Save custom translations in its Custom location underwp-content/languages/loco/so plugin updates do not overwrite them. - Content: posts, pages, menus, categories and product data. Multilingual plugins such as Polylang or WPML link each post to its translation, switch menus per language and output hreflang tags.
# install WordPress core and plugin language packs for Bangla
wp language core install bn_BD
wp language plugin install --all bn_BD
wp language theme install --all bn_BD
wp language core list --status=installed
Language packs cover only what has been translated on translate.wordpress.org; check your key plugins in Bangla before promising a fully Bangla checkout.
JavaScript apps: i18next with JSON message files
For React, Vue or plain JavaScript front ends, i18next is a common choice; react-i18next binds it to React, and Next.js projects often use next-intl instead. Keep one JSON file per language with the same keys:
// locales/en.json
{ "cart": { "title": "Your cart", "items": "{{n}} items", "empty": "Your cart is empty" } }
// locales/bn.json
{ "cart": { "title": "আপনার কার্ট", "items": "{{n}}টি পণ্য", "empty": "আপনার কার্ট খালি" } }
import i18next from 'i18next';
import en from './locales/en.json';
import bn from './locales/bn.json';
await i18next.init({
lng: document.documentElement.lang.startsWith('bn') ? 'bn' : 'en',
fallbackLng: 'en',
supportedLngs: ['bn', 'en'],
resources: { en: { translation: en }, bn: { translation: bn } },
});
const nf = new Intl.NumberFormat(i18next.language === 'bn' ? 'bn-BD' : 'en-US');
document.querySelector('#cart-count').textContent = i18next.t('cart.items', { n: nf.format(3) });
Formatting the number with Intl before passing it in means Bangla visitors see ৩টি পণ্য rather than a Latin 3 inside Bangla text. When you need real plural forms, i18next uses suffixed keys such as items_one and items_other with a count option; Bangla has the same two categories as English.
Bangla numbers, dates and currency
The bn-BD locale uses Bangla digits and South Asian grouping, where the first group has three digits and the rest have two (Intl.NumberFormat). The outputs below are from Node.js:
new Intl.NumberFormat('bn-BD').format(1234567.89)
// '১২,৩৪,৫৬৭.৮৯'
new Intl.NumberFormat('bn-BD', { style: 'currency', currency: 'BDT' }).format(1500)
// '১,৫০০.০০৳'
new Intl.NumberFormat('bn-BD', { numberingSystem: 'latn' }).format(1234567)
// '12,34,567' (lakh grouping with Latin digits)
new Intl.DateTimeFormat('bn-BD', { dateStyle: 'long' }).format(new Date(2026, 10, 17))
// '১৭ নভেম্বর, ২০২৬'
Decide once whether the Bangla site uses Bangla or Latin digits for prices and phone numbers, and apply it everywhere, including emails and invoices. On the PHP side, WordPress’s number_format_i18n() changes separators but not digits; the intl extension gives you the same output as JavaScript:
<?php
$fmt = new NumberFormatter( 'bn_BD', NumberFormatter::DECIMAL );
echo $fmt->format( 1234567.5 ); // ১২,৩৪,৫৬৭.৫
Keep raw numbers in the database and in form values, and convert only for display. A phone number or order ID typed in Bangla digits should be normalised to Latin digits before it is stored or validated.
Bangla fonts that render correctly
Bangla script relies on conjuncts and vowel signs that the font must shape correctly. Use a well-supported font such as Noto Sans Bengali or Hind Siliguri, self-host the WOFF2 file, and load it only for Bangla text with unicode-range:
@font-face {
font-family: "Noto Sans Bengali";
src: url("/fonts/NotoSansBengali-Variable.woff2") format("woff2");
font-weight: 100 900;
font-display: swap;
unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
:lang(bn) {
font-family: "Noto Sans Bengali", system-ui, sans-serif;
line-height: 1.7;
}
The range covers the Bengali block, the danda । (U+0964), which sits in the Devanagari block, and the zero-width joiners used in some conjuncts. A larger line height keeps vowel signs above and below the line from colliding. Avoid letter-spacing and text-transform on Bangla text, and test on a mid-range Android phone, not just a desktop browser. Preloading only the fonts the first screen needs keeps them from hurting load times; the WordPress speed optimization checklist covers font loading in more depth.
hreflang and SEO for Bangla and English pages
Each language version should have its own URL, a self-referencing canonical, the correct lang attribute and hreflang links to every alternate, including itself (localized versions):
<link rel="alternate" hreflang="en" href="https://example.com/pricing/">
<link rel="alternate" hreflang="bn" href="https://example.com/bn/pricing/">
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing/">
The hreflang guide for Bangla and English sites covers the rules and testing in full. Two mistakes are common on bilingual sites: canonicalising the Bangla page to the English one, which tells Google to drop it (see the canonical tags guide), and listing only one language in the XML sitemap (see the XML sitemap guide). Many sites keep English slugs under /bn/, because Bangla slugs become long percent-encoded strings when shared.
How to find missing translation keys
Untranslated strings slip in with every release. Check them in the build, not by browsing the site.
gettext projects
# counts translated, fuzzy and untranslated strings
msgfmt --statistics -o /dev/null languages/my-shop-bn_BD.po
# 120 translated messages, 3 fuzzy translations, 7 untranslated messages.
# list them
msgattrib --untranslated --no-obsolete languages/my-shop-bn_BD.po
msgattrib --only-fuzzy languages/my-shop-bn_BD.po
# strings in the code that the .po does not contain yet
wp i18n make-pot . /tmp/current.pot --domain=my-shop
msgcmp languages/my-shop-bn_BD.po /tmp/current.pot
Fuzzy entries are guesses made during a merge; WordPress does not use them, so review them like untranslated strings. Strings that never went through a gettext function will not appear in any of these reports; search templates for visible English text in HTML to catch those.
JSON message files
// scripts/missing-keys.mjs run: node scripts/missing-keys.mjs
import fs from 'node:fs';
const flat = (o, p = '') => Object.entries(o).flatMap(([k, v]) =>
v && typeof v === 'object' ? flat(v, p + k + '.') : [p + k]);
const en = new Set(flat(JSON.parse(fs.readFileSync('locales/en.json', 'utf8'))));
const bn = new Set(flat(JSON.parse(fs.readFileSync('locales/bn.json', 'utf8'))));
const missing = [...en].filter((k) => !bn.has(k));
if (missing.length) { console.error('Missing in bn.json:n' + missing.join('n')); process.exit(1); }
Run the script in CI so a pull request that adds an English key without a Bangla one fails. During development, i18next’s saveMissing option with a missingKeyHandler logs keys that the app requests but no resource file contains (i18next options).
Bangla and English website localization checklist
- Locale codes chosen per layer:
bn_BD,lang="bn", hreflangbn, Intlbn-BD. - Every visible string wrapped in gettext or an i18n key; no concatenated sentences.
- .pot regenerated each release; .po merged, translated and compiled to .mo, .l10n.php and JSON.
- Content translated through a multilingual plugin, with menus and categories per language.
- One rule for Bangla or Latin digits, applied to prices, dates, emails and invoices.
- Self-hosted Bangla font with
unicode-range, tested on Android. - Self-canonicals, reciprocal hreflang and both languages in the sitemap.
- Untranslated and fuzzy strings, and missing JSON keys, checked in CI.
Want this done on your own server or site?
I am Saizul Amin, a web developer and technical SEO consultant. I set up and harden VPS servers, migrate WordPress sites, fix indexing problems and build automations. See my portfolio or get in touch.
FAQ
What is the WordPress locale code for Bangla?
bn_BD, for Bangla as used in Bangladesh. In HTML and hreflang the language code is written with a hyphen or without a region, such as bn-BD or bn.
How do I translate a WordPress theme into Bangla?
Generate a .pot file with wp i18n make-pot, create a bn_BD .po file, translate it in Poedit or Loco Translate, then compile it to .mo and .l10n.php files in the theme or wp-content/languages.
How do I show numbers in Bangla digits?
Use Intl.NumberFormat with the bn-BD locale in JavaScript, or NumberFormatter with bn_BD from the PHP intl extension. Both return Bangla digits with lakh-style grouping.
Which font is best for Bangla websites?
Noto Sans Bengali and Hind Siliguri are reliable choices with good conjunct support. Self-host a WOFF2 file, load it with unicode-range and test on Android phones.
What is the difference between Loco Translate and Polylang?
Loco Translate edits the translation files of themes and plugins. Polylang translates your content, such as posts, pages and menus, and links each language version together.
How do I find untranslated strings in a .po file?
Run msgfmt –statistics to count them and msgattrib –untranslated to list them. Use msgcmp against a freshly generated .pot to find strings the .po does not contain yet.
Sources
- WordPress Developer Resources: How to internationalize your plugin
- WP-CLI Commands: wp i18n make-pot
- Google Search Central: Tell Google about localized versions of your page
- MDN: Intl.NumberFormat
- i18next: Configuration options

Saizul Amin is an AI agent developer, AI automation engineer and full-stack software developer from Dhaka, Bangladesh. He builds any kind of AI agent, AI automation and custom software for any business. Portfolio: https://saizul.com

