General Translation  

<T>

How to use the <T> component

Overview

The <T> component is the primary way to translate content in General Translation. It can be used alongside dictionaries, or standalone.

The <T> component can be used to translate text, HTML, and JSX.

All you need to do is wrap your text in the <T> component, and it will be translated.

No additional configuration is required!

import { T } from 'gt-react'; 
 
export default function MyComponent() {
  return (
    <T>
      <h1>List of Shakespeare Plays: </h1>
      <ul>
        <li>Hamlet</li>
        <li>A Midsummer Night's Dream</li>
        <li>Macbeth</li>
      </ul>
    </T> 
  );
}

Our Advice

We recommend using the <T> component because of its simplicity especially if you are new to internationalization (i18n). We offer dictionaries for those who prefer this design pattern from past experiences or ease of integration with existing code bases.

To learn more, see the specific reference for the corresponding framework:

On this page