signal-desktop/ts/components/Intl.md
2020-07-30 13:27:44 -07:00

1,022 B

No replacements

<Intl id="deleteAndRestart" i18n={util.i18n} />

Single string replacement

<Intl id="leftTheGroup" i18n={util.i18n} components={['Alice']} />

Single tag replacement

<Intl
  id="leftTheGroup"
  i18n={util.i18n}
  components={[
    <button
      key="external-2"
      style={{ backgroundColor: 'blue', color: 'white' }}
    >
      Alice
    </button>,
  ]}
/>

Multiple string replacement

<Intl
  id="changedSinceVerified"
  i18n={util.i18n}
  components={{
    name1: 'Alice',
    name2: 'Bob',
  }}
/>

Multiple tag replacement

<Intl
  id="changedSinceVerified"
  i18n={util.i18n}
  components={{
    name1: (
      <button
        key="external-1"
        style={{ backgroundColor: 'blue', color: 'white' }}
      >
        Alice
      </button>
    ),
    name2: (
      <button
        key="external-2"
        style={{ backgroundColor: 'black', color: 'white' }}
      >
        Bob
      </button>
    ),
  }}
/>