Verwendung

Translate text with plurals

Dieser Typ wird verwendet von localization.messages

tsx
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>
  );
}

Typdeklaration

ts
export type MessageValues = Readonly<Record<string, string | number | Date>>;

Typ

ts
{    readonly [x: string]: string | number | Date;}
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.