/** * @fileoverview Internationalization utilities for Nova components. * Provides automatic locale detection and default translations. */ /** * Gets the browser's locale (language code). * Falls back to 'en' if detection fails. * * @returns {string} The locale code (e.g., 'en', 'fr', 'de') */ export declare function getBrowserLocale(): string; /** * Gets the localized truncated results text. * Automatically detects browser locale and provides appropriate translation. * Falls back to English if translation is not available. * * @param {string} [locale] - Optional locale override. If not provided, uses browser locale. * @returns {string} The localized text with placeholders {shown} and {total} * * @example * getTruncatedResultsText() // Uses browser locale * getTruncatedResultsText('fr') // Returns French translation * getTruncatedResultsText('de') // Returns German translation */ export declare function getTruncatedResultsText(locale?: string): string; /** * Formats the truncated results text by replacing placeholders with actual values. * * @param {string} template - The text template with {shown} and {total} placeholders * @param {number} shown - The number of items shown * @param {number} total - The total number of items * @returns {string} The formatted text with replaced placeholders * * @example * formatTruncatedResults('{shown} of {total}', 10, 100) // '10 of 100' */ export declare function formatTruncatedResults(template: string, shown: number, total: number): string; /** * Texts used by the file tile. `{fileName}` is replaced by the file name. */ export interface FileTileTexts { /** Accessible name of the cancel action. */ cancel: string; /** Accessible name of the remove action. */ remove: string; /** Visible text of the retry action. */ retry: string; /** Announced next to the file name once the upload completed. */ complete: string; /** Accessible name of the progress bar while bytes are sent. */ uploading: string; /** Accessible name of the progress bar while the server processes the file. */ processing: string; } /** * Gets the localized file tile texts. * Falls back to English if the locale has no translation. * * @param {string} [locale] - Optional locale override. If not provided, uses browser locale. * @returns {FileTileTexts} The localized texts, with `{fileName}` placeholders. */ export declare function getFileTileTexts(locale?: string): FileTileTexts; /** * Replaces the `{fileName}` placeholder of a file tile text. * * @param {string} template - The text template. * @param {string} [fileName] - The file name to insert. * @returns {string} The text with the file name inserted. */ export declare function formatFileText(template: string, fileName?: string): string; /** * Texts used by the dropzone. */ export interface DropzoneTexts { /** Instruction line. `{browse}` is replaced by the browse link. */ instruction: string; /** Text of the browse link inside the instruction. */ browse: string; /** Instruction shown while one file is dragged over the zone. */ drop: string; /** Instruction shown while files are dragged over a zone that takes several. */ dropMultiple: string; } /** * Gets the localized dropzone texts. * Falls back to English if the locale has no translation. * * @param {string} [locale] - Optional locale override. If not provided, uses browser locale. * @returns {DropzoneTexts} The localized texts. */ export declare function getDropzoneTexts(locale?: string): DropzoneTexts; /** * The two forms of a counted text. `{count}` is replaced by the count. */ export interface PluralForms { /** Text used when the language treats the count as singular. */ one: string; /** Text used for every other count. */ other: string; } /** * Texts used by the file upload. Placeholders are written between braces. */ export interface FileUploadTexts { /** Message of a file whose type is not accepted. */ invalidType: string; /** Message of a file above the size limit. `{limit}` is the formatted limit. */ tooLarge: string; /** Summary shown when more files were added than allowed. `{max}` is the limit. */ tooMany: string; /** Helper text shown once the file limit is reached. `{max}` is the limit. */ limitReached: string; /** Size constraint of the helper text. `{value}` is the formatted limit. */ upTo: string; /** Count constraint of the helper text, by plural category. `{count}` is the limit. */ upToFiles: PluralForms; /** Summary of the uploaded files, by plural category. */ uploaded: PluralForms; /** Summary of the rejected files, by plural category. */ rejected: PluralForms; /** Summary of the failed uploads, by plural category. */ failed: PluralForms; /** Validation message of a required upload without any uploaded file. */ required: string; /** Names of the wildcard categories of `accept`, such as "image/*". */ categories: Record; } /** * Gets the localized file upload texts. * Falls back to English if the locale has no translation. * * @param {string} [locale] - Optional locale override. If not provided, uses browser locale. * @returns {FileUploadTexts} The localized texts. */ export declare function getFileUploadTexts(locale?: string): FileUploadTexts; /** * Replaces the `{name}` placeholders of a text. * * @param {string} template - The text template. * @param {Record} values - The values, by placeholder name. * @returns {string} The text with every known placeholder replaced. */ export declare function formatText(template: string, values: Record): string; /** * Picks the plural form matching a count and inserts the count in it. * * @param {PluralForms} forms - The text for one item and for several. * @param {number} count - The count, inserted as `{count}`. * @param {string} [locale] - Optional locale override. * @returns {string} The pluralized text. */ export declare function formatPlural(forms: PluralForms, count: number, locale?: string): string; /** * Joins alternatives the way the language does: "PDF or JPG", "PDF ou JPG". * * @param {string[]} items - The alternatives. * @param {string} [locale] - Optional locale override. * @returns {string} The joined list. */ export declare function formatAlternatives(items: string[], locale?: string): string;