Localization
Localize the messages your validators return so users always see clear, familiar text in their language. This page shows how to add keys, use them from validators, and keep things maintainable.
Quick start
- Pick message keys you’ll use in validators (for example:
filename-no-spaces
,collection-uniform-top-level-type
). - Add these keys to your locales using
UC.defineLocale
. - In validators, return
message: api.l10n('<your-key>')
. - Switch the uploader language and verify messages appear as expected.
Add your keys to locales
Import your current locales and extend them with validator-specific keys.
Use keys from validators
File validator example (no spaces in filename)
Collection validator example (uniform top‑level MIME type)