JavaScript i18n: Intl API के साथ Browser-Native अंतर्राष्ट्रीयकरण
JavaScript में संख्याओं, तिथियों और सूचियों को स्वरूपित करने तथा विभिन्न लोकेल में बहुवचन नियमों को संभालने के लिए Intl API एक अंतर्निर्मित मानक के रूप में शामिल है। किसी बाहरी लाइब्रेरी की आवश्यकता नहीं है। यह API सभी आधुनिक ब्राउज़रों और Node.js में समर्थित है, जो लोकेल-संवेदनशील स्ट्रिंग तुलना, विभाजन और सापेक्ष समय स्वरूपण को सीधे उपलब्ध कराती है।
जावास्क्रिप्ट Intl API की विशेषताएँ
व्यवहार में JavaScript Intl API
किसी भी आधुनिक browser या Node.js runtime में locale-विशिष्ट आउटपुट के साथ अंतर्निहित Intl constructors का उपयोग करके मुद्राओं, तिथियों और ordinals को format करें।
// Using the built-in Intl API
const formatter = new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR',
});
console.log(formatter.format(1234.56)); // "1.234,56 €"
// Date formatting
const date = new Intl.DateTimeFormat('ja-JP', {
year: 'numeric',
month: 'long',
day: 'numeric',
});
console.log(date.format(new Date())); // "2026年3月2日"
// Pluralization
const plural = new Intl.PluralRules('en');
const suffixes = { one: 'st', two: 'nd', few: 'rd', other: 'th' };
function ordinal(n) {
return `${n}${suffixes[plural.select(n)]}`;
}संबंधित गाइड
React i18n
जानें कि React applications component-based translation patterns के साथ i18n को कैसे संभालती हैं।
Next.js i18n
अंतर्निहित locale routing और server-side translation loading के साथ Next.js i18n देखें।
टीएमएस तुलनाएँ
अपने JavaScript project के लिए सबसे उपयुक्त translation management platforms की तुलना करें।
आज ही JavaScript i18n शुरू करें
AI-संचालित वर्कफ़्लो, CLI सिंक, और 50ms से कम में CDN डिलीवरी के साथ अपने जावास्क्रिप्ट ट्रांसलेशन्स का प्रबंधन करें।