Internationalization (i18n)

30 built-in locales, fully extensible registry

New in 5.1: 30 built-in locales (up from 20). English, Spanish, French, German, Japanese, Simplified & Traditional Chinese, Brazilian Portuguese, Italian, Dutch, Russian, Polish, Turkish, Korean, Czech, Vietnamese, Thai, Indonesian, Hindi, Swedish, Danish, Norwegian, Finnish, Greek, Ukrainian, Romanian, Hungarian, plus full RTL support for Arabic, Hebrew, and Persian (auto-flipped layout and mirrored progress UI). Pick a language below - buttons, drag-drop hints, status text, error messages, and the image-editor and media-capture modals all switch instantly. Add your own locale with one call to AjaxUploader.registerLocale().

Switch locale globally
AjaxUploader.setLocale('fr');
AjaxUploader.create('#uploader', { uploadUrl: '/upload' });
Right-to-left support

Arabic (ar), Hebrew (he), and Persian (fa) carry an RTL hint. Read it with getLocaleDir() and flip the container's dir attribute - all icons, progress bars, and the queue layout follow:

AjaxUploader.setLocale('ar');
container.setAttribute('dir', AjaxUploader.getLocaleDir()); // 'rtl'
AjaxUploader.create(container, { uploadUrl: '/upload' });
Register a custom locale

Pass a partial dictionary - missing keys fall back to English transparently:

AjaxUploader.registerLocale('sv', {
 selectFiles: 'Välj filer',
 dragDrop: 'Dra och släpp filer här',
 upload: 'Ladda upp',
 cancel: 'Avbryt',
 complete: 'Klar',
 failed: 'Misslyckades',
 fileTooLarge: 'Filen "{name}" ({size}) överskrider maxstorleken {max}.'
 // 30+ other keys fall back to English
});

AjaxUploader.setLocale('sv');
Translation key reference

Full key list with English defaults - translate only the ones you need:

// UI controls
selectFiles, dragDrop, dropHere, upload, browse,
cancel, remove, retry, pause, resume, clear,
// Status
uploading, complete, failed, cancelled, pending, remaining,
// Validation
maxFilesReached, fileTypeNotAllowed, fileTooLarge, fileTooSmall,
duplicateFile, mimeTypeNotAllowed,
imageTooWide, imageTooTall, imageTooNarrow, imageTooShort,
// Errors
networkError, uploadFailed, invalidResponse, chunkFailed,
// Stats
files, totalSize, speed, eta, of,
// Media capture
webcamPhotoTitle, webcamVideoTitle, screenCaptureTitle, audioCaptureTitle,
snap, record, stop, recording,
// Image editor
editorRotate, editorFlip, editorCrop, editorApply, editorSave, editorReset,
// URL import
importFromUrl, importingFrom
Interpolation

String values can include {name}-style placeholders that get filled in at render time:

AjaxUploader.registerLocale('en-pirate', {
 fileTooLarge: 'Arrr, the file "{name}" ({size}) be larger than the limit of {max}!'
});