Launching gt-next

The easiest way to internationalize your Next.js app

Back

Internationalization (i18n) sucks. We’re building a Next.js library, gt-next, to make it easier. Today we’re launching it in open beta.

npm i gt-next

With gt-next, translating your JSX content looks like this:

import { T } from 'gt-next'
 
export default function Page() {
    return (
        <T id='my_id'>
            <p>That's it! Wrap your JSX and it will be translated!</p>
        </T>
    )
}

That means:

  • No painful codebase rewrites
  • No waiting days for translations
  • Translations delivered right in your development environment

Just add some environment variables, run npx translate, and you’re done.

The goal with gt-next is to create an abudance mindset around translations. The web should be multilingual by default. And multilingual sites should work in 50 languages, not 5.

What you can do with gt-next

Format variables and plurals

import { T } from 'gt-next'
 
export default function Page() {
    
    const count = 2;
 
    return (
        <T id='my_id'>
            <Plural 
                n={count}
                singular={<>I have <Num/> book</>}
            >
                I have <Num/> books
            </Plural>
        </T>
    )
}

Use a developer API key to see translations locally

GT_API_KEY="gtx-dev-cae62d6fe1e33bda603c9a2926ab0fb8"
GT_PROJECT_ID="abcdef12-3456-789a-bcd4-ef123456789a"

Support over 100 languages out of the box, with on-demand translation.

landing

Edit your translations with an interactive JSX translation editor..

editor

Written by

Archie McKenzie

At

Sun Jan 07 2024