Overview
NDS writes its own words in the page’s language: button labels, screen reader labels, error messages, month names. Each NDS word in a canon carries a data-i18n marker, and NDS writes it from the pack of the page’s language. The words a script writes come from the same pack.
A pack is one JSON file per language, such as assets/i18n/ar.json. English needs none: it is in the markup and the scripts, so an English page loads no pack. The page picks the language with lang on <html>, and NDS loads the pack when its scripts start. Your own words carry no marker and are never translated: write them in the page’s language.
Pick another component when:
- you need to show a date in the page’s language: Date
Usage
Set the language on <html>. The base language names the file: ar-SA loads ar.json.
Each NDS word in a canon names its section and key in a marker. Keep the markers when you copy a canon: NDS writes those words in the page’s language. data-i18n marks an element’s text, and data-i18n-aria-label and its siblings mark an attribute.
Change a few texts with window.NDS_I18N_LANGS, in <head> before the NDS scripts. Put each text under its language, and name it by its section and key from the Word List. The keys you leave out keep the pack’s text.
window.NDS_I18N takes the same sections with no language, and each text it sets shows in every language. Use it only on a site that has one language.
Add a language NDS does not ship, such as French: copy the words of assets/i18n/en.json, which holds every NDS word in English, and translate them. Put them in window.NDS_I18N_LANGS.fr, in a script file of your own that every page loads before the NDS scripts. The words you leave out show in English. Never add a file to assets/i18n/: an NDS update replaces that folder.
Each language can sit in a file of its own: each file adds its language with Object.assign, as above. To split one language over several files, add each file’s sections to that language. Each file sets whole sections: two files that set validation for the same language replace one another.
Give your own component its text with NDS.i18n.getStrings(). Its English goes in the call. Each other language goes in window.NDS_I18N_LANGS, under the language and your component’s name.
Word List
Every word in the pack, by section and key, with its English and its Arabic. Each section is named after the component that reads it. weather holds the words of Weather, and date holds the Hijri month names and the long date format of Date. Change any word with window.NDS_I18N_LANGS. The same English words are in one file, assets/i18n/en.json, for you to translate.
| Key and English | Arabic |
|---|---|
accessibility.Accessibility Tools | أدوات إمكانية الوصول |
accessibility.Accessibility settings | إعدادات إمكانية الوصول |
accessibility.Close accessibility panel | إغلاق لوحة إمكانية الوصول |
accessibility.Toggle theme | تبديل المظهر |
accessibility.Scroll panel | تمرير اللوحة |
accessibility.Accessibility Modes | أوضاع إمكانية الوصول |
accessibility.Readable Experience | تجربة القراءة |
accessibility.Visually Pleasing Experience | التجربة البصرية |
accessibility.Readable experience controls | عناصر تحكم تجربة القراءة |
accessibility.Visual adjustments | التعديلات البصرية |
accessibility.Default | افتراضي |
accessibility.Font Sizing | حجم الخط |
accessibility.Dyslexia Friendly | داعم لعسر القراءة |
accessibility.Highlight Titles | تمييز العناوين |
accessibility.Highlight Links | تمييز الروابط |
accessibility.Reading Mask | مجهر القراءة |
accessibility.Pause Motion | إيقاف الحركة |
accessibility.Text Alignment | محاذاة النص |
accessibility.Line Height | ارتفاع السطر |
accessibility.Letter Spacing | تباعد الحروف |
accessibility.Word Spacing | تباعد الكلمات |
accessibility.Reset Settings | إعادة تعيين الإعدادات |
accessibility.Epilepsy Safe Mode | وضع مراعٍ للصرع |
accessibility.Stops motion and dampens color intensity | يوقف الحركة ويخفّف حدة الألوان |
accessibility.Visually Impaired Mode | وضع ذوي الإعاقة البصرية |
accessibility.Enlarges text and boosts contrast for clearer reading | يكبّر الخط ويعزّز التباين لقراءة أوضح |
accessibility.Cognitive Disability Mode | وضع داعم للإعاقة المعرفية |
accessibility.Highlights titles and stops motion to reduce distraction | يبرز العناوين ويوقف الحركة لتقليل الإلهاء |
accessibility.Motor Impaired Mode | وضع ذوي الإعاقة الحركية |
accessibility.Enlarges click targets | يكبّر مناطق النقر |
accessibility.Colorblind Mode | وضع عمى الألوان |
accessibility.Adjusts colors to distinguish red and green clearly | يضبط الألوان لتمييز الأحمر والأخضر بوضوح |
accessibility.Dyslexia Friendly Mode | وضع داعم لعسر القراءة |
accessibility.Uses a clearer font and widens line and word spacing | يستخدم خطًا أوضح ويوسّع تباعد الأسطر والكلمات |
accessibility.ADHD Friendly Mode | وضع داعم لاضطراب فرط الحركة وتشتت الانتباه |
accessibility.Stops motion, highlights titles, and enables the reading mask | يوقف الحركة ويبرز العناوين مع مجهر القراءة |
accessibility.Boost Contrast | تعزيز التباين |
accessibility.Monochrome | أحادي اللون |
accessibility.High Contrast | تباين عالٍ |
accessibility.High Saturation | تشبع عالٍ |
accessibility.Low Saturation | تشبع منخفض |
accessibility.Deuteranopia | عمى اللون الأخضر |
accessibility.on | مفعل |
accessibility.off | معطل |
accessibility.set to | تم الضبط على |
accessibility.All accessibility settings reset to default. | تمت إعادة تعيين جميع إعدادات إمكانية الوصول إلى الافتراضي. |
accessibility.Settings reset | تمت إعادة التعيين |
accessibility.active | نشط |
accessibility.Click again to confirm | انقر مرة أخرى للتأكيد |
accessibility.Press the reset button again to confirm. | اضغط زر إعادة التعيين مرة أخرى للتأكيد. |
accessibility.one: Confirm reset within 1 second. · other: Confirm reset within {n} seconds. | one: أكّد إعادة التعيين خلال ثانية واحدة. · two: أكّد إعادة التعيين خلال ثانيتين. · few: أكّد إعادة التعيين خلال {n} ثوانٍ. · many: أكّد إعادة التعيين خلال {n} ثانية. · other: أكّد إعادة التعيين خلال {n} ثانية. |
accessibility.Reset cancelled. | تم إلغاء إعادة التعيين. |
accessibility.Start | البداية |
accessibility.End | النهاية |
accessibility.Justify | مضبوط |
accessibility.Small | صغير |
accessibility.Medium | متوسط |
accessibility.Large | كبير |
accessibility.Reading mask controls | عناصر تحكم مجهر القراءة |
accessibility.Decrease mask band | تصغير شريط المجهر |
accessibility.Increase mask band | تكبير شريط المجهر |
accessibility.Drag mask vertically. Use arrow keys to nudge. | اسحب المجهر رأسيًا. استخدم مفاتيح الأسهم لتحريكه. |
accessibility.Close reading mask | إغلاق مجهر القراءة |
alert.Close | إغلاق |
alert.Close alert | إغلاق التنبيه |
autocomplete.No results | لا توجد نتائج |
autocomplete.Could not load suggestions | تعذر تحميل الاقتراحات |
autocomplete.Choose from the suggestions | اختر من الاقتراحات |
breadcrumb.More | المزيد |
breadcrumb.Breadcrumb | مسار التنقل |
calendar.one: 1 event · other: {n} events | one: فعالية واحدة · two: فعاليتان · few: {n} فعاليات · many: {n} فعالية · other: {n} فعالية |
calendar.No events on this day | لا توجد فعاليات في هذا اليوم |
calendar.Previous week | الأسبوع السابق |
calendar.Next week | الأسبوع القادم |
calendar.This week | هذا الأسبوع |
calendar.Last week | الأسبوع الماضي |
calendar.Previous month | الشهر السابق |
calendar.Next month | الشهر التالي |
calendar.Today | اليوم |
calendar.Grid | شبكة |
calendar.Rows | صفوف |
calendar.Month | شهر |
calendar.Days | الأيام |
calendar.Show all events | عرض كل الفعاليات |
chart.Chart | رسم بياني |
chart.Bar chart | رسم بياني بالأعمدة |
chart.Line chart | رسم بياني خطي |
code.Code language | لغة الشيفرة |
cookies.Cookie settings | إعدادات ملفات تعريف الارتباط |
cookies.Cookies | ملفات تعريف الارتباط |
cookies.This site uses cookies to make it easy to use and to improve your experience. If you continue to browse, you accept the Terms and Conditions of this site and its use of cookies. | يستخدم هذا الموقع ملفات تعريف الارتباط لتسهيل استخدامه وتحسين تجربتك. باستمرارك في التصفح، فإنك توافق على استخدامها. |
cookies.Accept | قبول |
cookies.Reject | رفض |
cookies.Manage | إدارة |
cookies.Close | إغلاق |
cookies.Scroll panel | تمرير اللوحة |
cookies.Manage Cookies | إدارة ملفات تعريف الارتباط |
cookies.This site stores cookies on your browser. They are mostly used to make the site work as you expect. They do not usually identify you. You can turn off some types below, but parts of the site and its services may then not work. | يخزّن هذا الموقع ملفات تعريف الارتباط على متصفحك، وتستخدم غالبًا ليعمل الموقع كما تتوقع. لا تعرّف هذه الملفات بك عادةً. يمكنك إيقاف بعض أنواعها أدناه، لكن قد لا تعمل بعض أجزاء الموقع أو خدماته بعدها. |
cookies.Cookie types | أنواع ملفات تعريف الارتباط |
cookies.Necessary Cookies | ملفات تعريف الارتباط الضرورية |
cookies.Always active | نشطة دائمًا |
cookies.Performance Cookies | ملفات تعريف الارتباط الخاصة بالأداء |
cookies.Functional Cookies | ملفات تعريف الارتباط الوظيفية |
cookies.Targeting Cookies | ملفات تعريف الارتباط المستهدفة |
cookies.Confirm My Choices | تأكيد اختياراتي |
cookies.Reject All | رفض الكل |
cookies.Thank you! | شكرًا لك! |
cookies.Your choice is saved. To change it, select Undo. | تم حفظ اختيارك. لتغييره، اختر «تراجع». |
cookies.Undo | تراجع |
copy.Copied | تم النسخ |
copy.Copy code | نسخ الشيفرة |
custom-select.Please select an option | يرجى اختيار خيار |
date.Muharram · Safar · Rabi al-Awwal · Rabi al-Thani · Jumada al-Ula · Jumada al-Akhirah · Rajab · Shaban · Ramadan · Shawwal · Dhu al-Qadah · Dhu al-Hijjah | محرم · صفر · ربيع الأول · ربيع الثاني · جمادى الأولى · جمادى الآخرة · رجب · شعبان · رمضان · شوال · ذو القعدة · ذو الحجة |
date.AH | هـ |
date.MMMM D, YYYY | D MMMM YYYY |
date-picker.Select month | اختيار الشهر |
date-picker.Select year | اختيار السنة |
date-picker.Previous month | الشهر السابق |
date-picker.Next month | الشهر التالي |
date-picker.Today | اليوم |
date-picker.Close | إغلاق |
date-picker.Clear | مسح |
date-picker.Save | حفظ |
date-picker.Invalid date — expected format {format} | تاريخ غير صالح — الصيغة المطلوبة {format} |
date-picker.Earliest allowed date is {date} | أبكر تاريخ مسموح به {date} |
date-picker.Latest allowed date is {date} | آخر تاريخ مسموح به {date} |
date-picker.{date} is not available. Pick another day | {date} غير متاح. اختر يومًا آخر |
date-picker.Start date must come before end date | تاريخ البداية يجب أن يسبق تاريخ النهاية |
date-picker.Converted from the Hijri date {date} | حُوِّل من التاريخ الهجري {date} |
date-picker.Converted from the Gregorian date {date} | حُوِّل من التاريخ الميلادي {date} |
date-picker.Open calendar | فتح التقويم |
digital-stamp.A government website registered with the Digital Government Authority. | موقع إلكتروني حكومي مسجل لدى هيئة الحكومة الرقمية. |
digital-stamp.Government website registered with DGA | موقع حكومي مسجل لدى هيئة الحكومة الرقمية |
digital-stamp.How you know? | كيف تتحقق؟ |
digital-stamp.Digital government stamp | ختم الحكومة الرقمية |
digital-stamp.Saudi Arabia flag | علم المملكة العربية السعودية |
digital-stamp.Digital Government Authority | هيئة الحكومة الرقمية |
digital-stamp.Registered on Digital Government Authority: | مسجل لدى هيئة الحكومة الرقمية برقم: |
digital-stamp.Official Reliable websites use | المواقع الإلكترونية الحكومية الموثوقة تستخدم بروتوكول |
digital-stamp.Ensure the website is using the HTTPS protocol. | تحقق من أن الموقع يستخدم بروتوكول HTTPS |
digital-stamp.Official Saudi Government websites URL ends with | روابط المواقع الإلكترونية الرسمية الحكومية تنتهي بـ |
digital-stamp..gov.sa | gov.sa |
digital-stamp.Website belongs to an official government organization in the Kingdom of Saudi Arabia always ends with .gov.sa . | جميع روابط المواقع الرسمية التابعة للجهات الحكومية في المملكة العربية السعودية تنتهي بـ .gov.sa |
digital-stamp.Official Saudi educational websites URL ends with | روابط المواقع الإلكترونية الرسمية التعليمية السعودية تنتهي بـ |
digital-stamp..edu.sa | edu.sa |
digital-stamp.Website belongs to an official educational in the Kingdom of Saudi Arabia always ends with .edu.sa or sch.sa . | جميع روابط المواقع الرسمية التعليمية في المملكة العربية السعودية تنتهي بـ sch.sa أو edu.sa |
digital-stamp.Official Saudi educational websites URL ends with | روابط المواقع الإلكترونية الرسمية التعليمية السعودية تنتهي بـ |
digital-stamp..sch.sa | sch.sa |
digital-stamp.Website belongs to an official educational in the Kingdom of Saudi Arabia always ends with .edu.sa or sch.sa . | جميع روابط المواقع الرسمية التعليمية في المملكة العربية السعودية تنتهي بـ sch.sa أو edu.sa |
digital-stamp.Official Saudi medical websites URL ends with | روابط المواقع الإلكترونية الرسمية الطبية السعودية تنتهي بـ |
digital-stamp..med.sa | med.sa |
digital-stamp.Website belongs to an official medical in the Kingdom of Saudi Arabia always ends with .med.sa . | جميع روابط المواقع الرسمية الطبية في المملكة العربية السعودية تنتهي بـ med.sa |
digital-stamp.Official Saudi non-profit organizations websites URL ends with | روابط المواقع الإلكترونية الرسمية للمؤسسات غير الربحية السعودية تنتهي بـ |
digital-stamp..org.sa | org.sa |
digital-stamp.Website belongs to an official non-profit organizations in the Kingdom of Saudi Arabia always ends with .org.sa . | جميع روابط المواقع الرسمية للمؤسسات غير الربحية في المملكة العربية السعودية تنتهي بـ org.sa |
digital-stamp.Official Saudi activities and initiatives websites URL ends with | روابط المواقع الإلكترونية الرسمية للأنشطة والمبادرات السعودية تنتهي بـ |
digital-stamp..sa | .sa |
digital-stamp.Website belongs to an official activities and initiatives in the Kingdom of Saudi Arabia always ends with .sa . | جميع روابط المواقع الرسمية للأنشطة والمبادرات في المملكة العربية السعودية تنتهي بـ .sa |
drawer.Search the menu | البحث في القائمة |
drawer.Search… | بحث… |
drawer.Clear search | مسح البحث |
drawer.No results | لا توجد نتائج |
dropmenu.Search items | البحث في العناصر |
dropmenu.Search… | بحث… |
dropmenu.Clear search | مسح البحث |
dropmenu.No results | لا توجد نتائج |
dropmenu.Please select an option | يرجى اختيار خيار |
editor.Undo | تراجع |
editor.Redo | إعادة |
editor.Clear formatting | مسح التنسيق |
editor.Remove component | إزالة المكون |
editor.Bold | غامق |
editor.Italic | مائل |
editor.Underline | تسطير |
editor.Strikethrough | يتوسطه خط |
editor.Insert link | إدراج رابط |
editor.Insert image | إدراج صورة |
editor.Heading 1 | عنوان 1 |
editor.Heading 2 | عنوان 2 |
editor.Heading 3 | عنوان 3 |
editor.Heading 4 | عنوان 4 |
editor.Bulleted list | قائمة نقطية |
editor.Numbered list | قائمة رقمية |
editor.Align left | محاذاة لليسار |
editor.Align center | توسيط |
editor.Align right | محاذاة لليمين |
editor.Justify | ضبط |
editor.Left to right | من اليسار إلى اليمين |
editor.Right to left | من اليمين إلى اليسار |
editor.View HTML source | عرض مصدر HTML |
editor.URL | الرابط |
editor.Text | النص |
editor.Open in new tab | فتح في تبويب جديد |
editor.Colored link | رابط ملون |
editor.Hide external badge | إخفاء شارة الرابط الخارجي |
editor.From link | من رابط |
editor.OR | أو |
editor.Attributes | الخصائص |
editor.Enter a valid image URL | أدخل رابط صورة صالحًا |
editor.Enter a valid URL | أدخل رابطًا صالحًا |
editor.Wait for the upload to finish | انتظر حتى يكتمل الرفع |
editor.The file was not uploaded. Choose another file or enter a link | لم يتم رفع الملف. اختر ملفًا آخر أو أدخل رابطًا |
editor.Pasting images is not available — use the image dialog | لصق الصور غير متاح — استخدم نافذة إدراج الصورة |
editor.Selection crosses a component — adjust it before pasting | التحديد يتجاوز حدود مكون — عدّل التحديد قبل اللصق |
editor.Alt text | النص البديل |
editor.Width (px) | العرض (بكسل) |
editor.Height (px) | الارتفاع (بكسل) |
editor.Upload image | رفع صورة |
editor.Cancel | إلغاء |
editor.Insert | إدراج |
editor.Unlink | إزالة الرابط |
editor.Remove the component: | إزالة المكون: |
empty.No content to show | لا يوجد محتوى لعرضه |
expandable.Show More | عرض المزيد |
expandable.Show Less | عرض أقل |
export.one: Exported {n} row · other: Exported {n} rows | zero: لم يتم تصدير أي صف · one: تم تصدير صف واحد · two: تم تصدير صفين · few: تم تصدير {n} صفوف · many: تم تصدير {n} صفًا · other: تم تصدير {n} صف |
export.Export | تصدير |
filter.Could not update results | تعذر تحديث النتائج |
filter.Something went wrong applying the filter. The results shown are unchanged. | حدث خطأ أثناء تطبيق التصفية. النتائج المعروضة لم تتغير. |
filter.No results | لا توجد نتائج |
filter.No item matches the current filters. | لا توجد نتائج لمعايير التصفية الحالية |
filter.No options to filter by | لا توجد خيارات للتصفية |
filter.Clear filters | مسح التصفية |
filter.All | الكل |
filter.Apply | تطبيق |
filter.Minimum | الحد الأدنى |
filter.Maximum | الحد الأقصى |
filter.Maximum value | القيمة القصوى |
filter.Filter | تصفية |
filter.Reset | إعادة تعيين |
filter.Applied Filters: | التصفيات المطبقة: |
filter.Search | بحث |
footer.Site Footer | تذييل الموقع |
footer.Footer navigation | روابط التذييل |
form.Minimum value is {n} | الحد الأدنى {n} |
form.Maximum value is {n} | الحد الأقصى {n} |
form.Arabic characters are not allowed | الأحرف العربية غير مسموح بها |
form.Loading | جارٍ التحميل |
form.Show password | إظهار كلمة المرور |
form.Hide password | إخفاء كلمة المرور |
form.Clear input | مسح المدخل |
form.Clear search | مسح البحث |
form.Suggestions: | اقتراحات: |
form.Decrease value | تقليل القيمة |
form.Increase value | زيادة القيمة |
form.Clear | مسح |
formatted-input.Invalid national ID number | رقم الهوية غير صحيح |
formatted-input.Invalid IBAN | رقم الآيبان غير صحيح |
formatted-input.Invalid VAT number | الرقم الضريبي غير صحيح |
formatted-input.Incomplete value | القيمة غير مكتملة |
formatted-input.Invalid value | القيمة غير صحيحة |
ipv.Image viewer | عارض الصور |
ipv.Zoom in | تكبير |
ipv.Zoom out | تصغير |
ipv.Reset zoom | إعادة ضبط التكبير |
ipv.Toggle controls | إظهار/إخفاء الأدوات |
ipv.Close | إغلاق |
ipv.Previous image | الصورة السابقة |
ipv.Next image | الصورة التالية |
ipv.Controls: | أزرار التحكم: |
ipv.• Scroll to zoom | • مرّر للتكبير |
ipv.• Drag to pan | • اسحب للتحريك |
ipv.• Double-click to reset | • النقر المزدوج لإعادة الضبط |
ipv.• Arrow keys to navigate | • أسهم لوحة المفاتيح للتنقل |
ipv.• H key to toggle UI | • المفتاح H لإظهار/إخفاء الأدوات |
ipv.• ESC to close | • ESC للإغلاق |
main-nav.Primary navigation | التنقل الرئيسي |
main-nav.Toggle navigation menu | فتح/إغلاق قائمة التنقل |
modal.Close | إغلاق |
modal.Close dialog | إغلاق النافذة |
multiselect.{label}: No selection | {label}: لا يوجد تحديد |
multiselect.Added {value} | تمت إضافة {value} |
multiselect.Removed {value} | تمت إزالة {value} |
multiselect.Selection cleared | تم مسح التحديد |
multiselect.Applied {value} | تم تطبيق {value} |
multiselect.Reset | إعادة تعيين |
multiselect.Apply | تطبيق |
otp.Digit {n} of {total} | الرقم {n} من {total} |
otp.Please enter all {n} digits | يرجى إدخال جميع الأرقام |
pagination.Previous page | الصفحة السابقة |
pagination.Next page | الصفحة التالية |
pagination.Page {n} | الصفحة {n} |
pagination.More pages | المزيد من الصفحات |
pagination.Jump to page | الانتقال إلى صفحة |
pagination.Pagination | ترقيم الصفحات |
panel.Close panel | إغلاق اللوحة |
panel.Make panel smaller | تصغير اللوحة |
panel.Make panel larger | تكبير اللوحة |
password.The two passwords do not match | كلمتا المرور غير متطابقتين |
password.{n} of {total} password rules met | تم استيفاء {n} من {total} من شروط كلمة المرور |
password.Clear password | مسح كلمة المرور |
radio.Please select an option | يرجى اختيار خيار |
rating.one: {n} star · other: {n} stars | zero: {n} نجمة · one: نجمة واحدة · two: نجمتان · few: {n} نجوم · many: {n} نجمة · other: {n} نجمة |
rating.{n} of {total} | {n} من {total} |
rating.Please choose a rating | يرجى اختيار تقييم |
rating.Vote | تصويت |
scroll-more.Show more | عرض المزيد |
selection.Select all | تحديد الكل |
selection.Clear all | مسح الكل |
session-timeout.Your session is about to end | جلستك على وشك الانتهاء |
session-timeout.You have not used the page for a while. When the time runs out, you are signed out and lose any data you have not saved. | لم تستخدم الصفحة منذ مدة. عند انتهاء الوقت يتم تسجيل خروجك، وتفقد أي بيانات لم تحفظها. |
session-timeout.Stay signed in | البقاء متصلًا |
session-timeout.Sign out | تسجيل الخروج |
session-timeout.Your session has ended | انتهت جلستك |
session-timeout.You were signed out because the page was not used. Sign in again to continue. | تم تسجيل خروجك لعدم استخدام الصفحة. سجّل الدخول مرة أخرى للمتابعة. |
session-timeout.Sign in | تسجيل الدخول |
share.Share Page | مشاركة الصفحة |
share.Share on X | المشاركة على X |
share.Share on LinkedIn | المشاركة على لينكدإن |
share.Share on WhatsApp | المشاركة على واتساب |
share.Copy Link | نسخ الرابط |
share.More Options | خيارات أخرى |
sidemenu.Sidebar | الشريط الجانبي |
sidemenu.Sidebar Menu | قائمة الشريط الجانبي |
sort.Sort | ترتيب |
swiper.Go to page {n} | الانتقال إلى الصفحة {n} |
swiper.Pause slides | إيقاف الشرائح مؤقتًا |
swiper.Previous slide | الشريحة السابقة |
swiper.Next slide | الشريحة التالية |
table.Reset | إعادة تعيين |
table.Column {n} | العمود {n} |
table.Columns | الأعمدة |
table.Visible columns | الأعمدة المرئية |
table.Toggle details | إظهار/إخفاء التفاصيل |
taginput.Added {value} | تمت إضافة {value} |
taginput.Removed {value} | تمت إزالة {value} |
taginput.Editing {value} | تعديل {value} |
taginput.Already added | مضاف مسبقًا |
taginput.Maximum limit {n} | الحد الأقصى {n} |
taginput.All tags removed | تمت إزالة جميع الوسوم |
taginput.Choose from the suggestions | اختر من الاقتراحات |
taginput.Please add at least one tag | يرجى إضافة وسم واحد على الأقل |
time-picker.Hour | ساعة |
time-picker.Minute | دقيقة |
time-picker.Second | ثانية |
time-picker.AM/PM | ص/م |
time-picker.AM | ص |
time-picker.PM | م |
time-picker.Pick a time | اختيار الوقت |
time-picker.Invalid time — expected format {format} | وقت غير صالح — الصيغة المطلوبة {format} |
time-picker.Enter the hour and the minute | أدخل الساعة والدقيقة |
time-picker.Earliest allowed time is {time} | أبكر وقت مسموح به {time} |
time-picker.Latest allowed time is {time} | آخر وقت مسموح به {time} |
time-picker.This field is required | هذا الحقل مطلوب |
toc.On this page | في هذه الصفحة |
toc.Table of contents | جدول المحتويات |
tooltip.More info | مزيد من المعلومات |
topbar.Toggle dark mode | تبديل الوضع الداكن |
topbar.Top bar utilities | أدوات الشريط العلوي |
topbar.Choose a theme | اختيار المظهر |
upload.File size exceeds {size} | حجم الملف يتجاوز {size} |
upload.File type not allowed | نوع الملف غير مسموح |
upload.File type not allowed (.{ext}) | نوع الملف غير مسموح (.{ext}) |
upload.Maximum number of files reached ({n}) | تم الوصول إلى الحد الأقصى لعدد الملفات ({n}) |
upload.Network error | خطأ في الشبكة |
upload.Upload timed out | انتهت مهلة الرفع |
upload.Upload cancelled | تم إلغاء الرفع |
upload.Upload failed | فشل الرفع |
upload.Remove file | إزالة الملف |
upload.Please add a file | يرجى إرفاق ملف |
upload.Please wait for the upload to finish | يرجى الانتظار حتى يكتمل الرفع |
upload.Drag and drop files here to upload | اسحب الملفات وأفلتها هنا للرفع |
upload.Browse Files | استعراض الملفات |
user-feedback.Your feedback is submitted! | تم استلام ملاحظتك! |
user-feedback.An error occurred, please try again | حدث خطأ، يرجى المحاولة مرة أخرى |
validation.This field is required | هذا الحقل مطلوب |
validation.Invalid input | مدخل غير صحيح |
validation.Please enter a valid email address | يرجى إدخال عنوان بريد إلكتروني صحيح |
validation.Please enter a valid URL | يرجى إدخال رابط صحيح |
validation.Please use the correct format | يرجى استخدام الصيغة الصحيحة |
validation.Input is too short (minimum {n} characters) | المدخل قصير جدًا (الحد الأدنى {n}) |
validation.Input is too long (maximum {n} characters) | المدخل طويل جدًا (الحد الأقصى {n}) |
validation.Value must be at least {n} | القيمة يجب أن تكون على الأقل {n} |
validation.Value must be no more than {n} | القيمة يجب ألا تزيد على {n} |
validation.one: Please select at least 1 option · other: Please select at least {n} options | one: يرجى اختيار خيار واحد على الأقل · two: يرجى اختيار خيارين على الأقل · few: يرجى اختيار {n} خيارات على الأقل · many: يرجى اختيار {n} خيارًا على الأقل · other: يرجى اختيار {n} خيار على الأقل |
validation.one: Please select no more than 1 option · other: Please select no more than {n} options | one: يرجى اختيار خيار واحد كحد أقصى · two: يرجى اختيار خيارين كحد أقصى · few: يرجى اختيار {n} خيارات كحد أقصى · many: يرجى اختيار {n} خيارًا كحد أقصى · other: يرجى اختيار {n} خيار كحد أقصى |
validation.Still loading. Try again in a moment | جارٍ التحميل، يرجى المحاولة بعد قليل |
voice-input.Start voice input ({language}) | بدء الإدخال الصوتي ({language}) |
voice-input.Stop voice input | إيقاف الإدخال الصوتي |
voice-input.English | العربية |
voice-input.No speech detected | لم يتم اكتشاف صوت |
voice-input.Microphone permission required | مطلوب إذن الميكروفون |
voice-input.Microphone access denied | تم رفض الوصول للميكروفون |
voice-input.Network error | خطأ في الشبكة |
voice-input.Voice input cancelled | تم إلغاء الإدخال الصوتي |
voice-input.Language not supported | اللغة غير مدعومة |
voice-input.Voice input error | خطأ في الإدخال الصوتي |
voice-input.Voice input timed out | انتهت مهلة الإدخال الصوتي |
voice-input.Voice input is not supported in this browser | الإدخال الصوتي غير مدعوم في هذا المتصفح |
voice-input.Voice input | الإدخال الصوتي |
voice-input.Start voice input | بدء الإدخال الصوتي |
weather.{desc}, {temp}{unit} | {desc}، {temp}{unit} |
weather.· {desc}, {temp}{unit} | · {desc}، {temp}{unit} |
weather.°C | °م |
weather.°F | °ف |
weather.Clear | صافي |
weather.Partly Cloudy | غائم جزئيًا |
weather.Overcast | غائم |
weather.Fog | ضباب |
weather.Rain | أمطار |
weather.Snow | ثلوج |
weather.Storm | عاصفة |
Behavior
Lookup Order
NDS looks for each word in this order: your window.NDS_I18N_LANGS override for the language, your window.NDS_I18N override, the pack, then the English in the markup or the script. A marked word found nowhere keeps the word in the markup. A key a script asks for and finds nowhere shows its own name.
Pack Timing
NDS starts to load the pack of the page’s language as soon as its scripts run, once per page, and the browser caches it. The link carries the ?ver= of the NDS scripts, so a new release never shows the old text. An English page loads no pack, and a language with no pack shows the English.
The components in the bundles that load after the page shows start once the pack is in, so they write their text in the page’s language. They wait 3 seconds at most, then start anyway.
Skeleton
On a page that is not in English, each marked word shows a bar in its place until the pack is in, so the page never shows English first. Expandable Content’s Show More button and Empty’s message are two such words. A screen reader label is written again once the pack is in, unless something changed it since. If the NDS scripts never run, the bar goes after 4 seconds.
Plurals and Values
A value can name parts that the component fills in, such as {n} or {value}. A value can also be an object of plural forms: zero, one, two, few, many and other, picked by n with the plural rules of the language. Only other is required: a form the object lacks uses other. Arabic uses all six, English uses one and other.
Field Language
A Date Picker field with data-lang or lang writes its calendar in that language, not the page’s. NDS loads that language’s file when the field first needs it. A date-picker override in window.NDS_I18N_LANGS shows in the fields of its own language. One in window.NDS_I18N shows in that field too, whatever its language.
Language Change
Set lang and dir on <html> to change the page’s language with no reload. NDS loads the pack of the new language, then writes each marked word again. A word that a script or you changed stays as it is. NDS does not set dir: set it with lang.
The components that write their own words, such as Calendar, Countdown, Chart and File Upload, draw them again in the new language. Open menus, filters and form values stay as they are. A message that is already on screen, such as a field error, stays in the old language until it shows again.
A language library in a single-page app, such as vue-i18n or i18next, can set the two attributes: NDS needs no call of its own. Your own words change with your library. A server-rendered site loads the page again, for the words it writes itself.
Frameworks
Keep the markers in JSX and in Vue and Angular templates. NDS writes each word into the text node that the framework made, so a later render keeps the word. When a word changes with state, change its marker with it, such as data-i18n="expandable.show_less" on Show Less.
A morph, as in Livewire, Turbo or htmx, writes the server’s English back into the page. NDS.init.mount(root) after each morph translates it again, as it starts the components in it (see HTML Swaps). A framework that hydrates server HTML starts NDS after hydration: see Hydration.
NDS does not translate markers inside a shadow root.
Missing Pack
When the pack fails to load, the components show their English text. A failure other than a missing file logs [NDS.i18n] ar failed, with the page’s language in place of ar. NDS looks for the pack in the i18n/ folder beside the folder that holds nds-main.min.js. When your files sit somewhere else, set NDS_I18N_PATH.
Built-in Features
-
Words in the Markup
Each NDS word in a canon carries a marker, so the markup you copy shows in the page's language with no script of your own.
-
Arabic and English
Every component ships its text in both languages, its screen reader labels and messages included.
-
One File per Language
All the text of a language is one request, so a page that has ten components loads one file, not ten. An English page loads none.
-
Key by Key Overrides
window.NDS_I18N_LANGSchanges only the keys you set, in the language you set them for. The rest of the component keeps its text in the page's language. -
Any Language
A language NDS does not ship needs no file and no change to the scripts: its words go in
window.NDS_I18N_LANGS, and a word you leave out shows in English. -
Plural Rules
A count picks the right form for the language, such as «خيار واحد», «خيارين» and «11 خيارًا» in Arabic.
-
Month and Day Names
The browser names the Gregorian months and the weekdays in the page's language. The Hijri month names come from the pack, since some Android browsers name them wrong.
-
Text Stays Text
Components escape pack text before they put it in HTML, and a marker writes only text and text attributes. A value in the pack can never run as code.
Best Practices
- Set
langanddiron<html>on every page. The pack followslang, and the layout followsdir. - Keep the
data-i18nmarkers in the markup you copy from a canon. NDS writes each marked word in the page’s language. Remove a marker only where you write your own word. - Never edit the NDS scripts to change their text. Their English is only a fallback, and an upgrade replaces it.
- Use
window.NDS_I18N_LANGSto change any text. Never editassets/i18n/: an NDS update replaces it. - Set
window.NDS_I18N_LANGSbefore the NDS scripts run, inline in<head>or in a script file that loads before them. A component that already wrote its text keeps the old text. - Put each override under its language in
window.NDS_I18N_LANGS. A key inwindow.NDS_I18Nreplaces that text in every language, so use it only on a site that has one language. - Add to
window.NDS_I18N_LANGSwithObject.assign, as in the example. A plainwindow.NDS_I18N_LANGS = { … }drops the languages another script set. - Set each section of a language in one script only. A script that adds sections to a language another script set merges into it, as in the example: a plain
{ ar: { … } }replaces that language. - Run
NDS.audit.run()after you write an override. It names a section or key that NDS does not have, which changes nothing. - To change one element’s text, use its own attribute where the component has one, such as
data-empty-messageordata-filter-all-label. The pack sets the text of every element. - Keep the
{n}-style parts of a value when you translate it. A part you drop no longer shows its value. - Write your own markup in the page’s language.
- Keep your own component’s text under its own name in
window.NDS_I18N_LANGS, never in an NDS section.
API
Data Attributes
A marker names a word of the pack as section.key. NDS writes that word in the page’s language: on load, whenever marked markup joins the page, and when lang on <html> changes. A word that a script or you changed since stays as it is.
| Attribute | Element | Effect |
|---|---|---|
data-i18n="section.key" |
an element that holds only the word | The word replaces the element’s text |
data-i18n-aria-label, -aria-description, -title, -alt, -placeholder, -label |
an element that has that attribute | The word goes in that attribute |
data-i18n-vars='{"n":3}' |
an element with a marker | Fills the {name} parts and picks the plural form of its markers’ words. Give it numbers and plain values only: a word or a formatted date in it stays in its old language |
data-nds-i18n |
<html> |
NDS sets it once the page’s words are in |
Configuration
Set these on window before the NDS scripts. The paths are not needed when the files sit in i18n/ beside the folder that holds nds-main.min.js. A language file on another origin needs CORS headers.
| Global | Default | Effect |
|---|---|---|
NDS_I18N_LANGS |
— | Text by language, component and key, laid over the files: { ar: { validation: { required: '…' } } } |
NDS_I18N |
— | Text by component and key, in every language: { validation: { required: '…' } }. NDS_I18N_LANGS wins over it |
NDS_I18N_PATH |
i18n/ in the assets/ folder the NDS scripts load from |
The folder the language files load from. End it with /. It wins over NDS_ASSETS_PATH |
NDS_ASSETS_PATH |
the folder above the one that holds nds-main.min.js |
The assets/ folder. The language files load from its i18n/ folder, and the other bundles from its js/ folder |
JavaScript
| Method | Effect |
|---|---|
NDS.i18n.getStrings(component, defaults) |
Returns the text of one component, with defaults as its English. The methods below are on the object it returns |
.text(key, vars, lang) |
Returns the text for key in the page’s language, with vars filled in. With lang, in that language: the first call loads its file |
.set(element, attribute, key, vars) |
Writes the word in attribute ('text' is the element’s text). The six marker attributes and the text also get their marker, and vars goes in data-i18n-vars, so NDS keeps the word in the page language. Another attribute’s word is written again once the pack is in, unless it changed since |
.load(lang) |
Returns a promise of the words, in the page’s language or lang |
.ready(lang) |
Returns true once the text of that language is in |
.has(key) |
Returns true when defaults has key. Use it for a key that comes from outside, such as a value from storage |
NDS.i18n.load(component, lang) |
Returns a promise of a component’s words |
NDS.i18n.translate(root) |
Writes the words of the markers in root now. NDS.init.mount() and refresh() call it |
NDS.i18n.format(value, vars, lang) |
Fills {name} parts from vars, and picks a plural form by vars.n |
NDS.i18n.pack() |
Returns a promise of the page language’s pack |
NDS.i18n.resolveLang(lang) |
Returns lang, or the page’s language, as a base tag: ar-SA gives ar. A value that is not a language gives en |
NDS.i18n.has(section, key) |
Returns true when a getStrings() call declared section, or key in it |
NDS.i18n.isMissing(lang) |
Returns true when the file of lang, or of the page’s language, did not load. The components then show English |
Events
| Event | Target | Detail | When |
|---|---|---|---|
nds:language:change |
<html>, bubbles |
{ lang } |
lang on <html> changed, the new pack is in, and the markers show its words. Draw again what your component formats itself, such as a date |
The full API is in the banner of _js/nds-core.js, and in the comment above NDS.i18n there.