MessageCatalogs
Messages by key, in catalogs by BCP 47 tag; the first catalog is the fallback.
Utilisation
Translate text with plurals
Ce type est utilisé par localization.messages
import { HStack, Symbol, Text, localization } from 'kuito';
const t = localization.messages({
en: { inbox: '{count, plural, =0 {No messages} one {# message} other {# messages}}' },
ar: { inbox: '{count, plural, zero {لا رسائل} one {رسالة واحدة} other {# رسائل}}' },
});
export function Inbox() {
return (
<HStack paddingInlineStart={16} paddingInlineEnd={8} gap={8} alignItems="center">
<Symbol name={{ ios: 'tray', android: 'inbox' }} />
<Text>{t('inbox', { count: 3 })}</Text>
</HStack>
);
}Déclaration du type
export type MessageCatalogs = Readonly<Record<string, Readonly<Record<string, string>>>>;Type
{ readonly [x: string]: Readonly<Record<string, string>>;}Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.