General Translation (GT) is a one-stop solution for launching software in multiple languages.
The full GT stack includes:
- Open source developer libraries
- Context-aware translation APIs
- A platform for translation management
Install the libraries in your project, add <T>
tags, and see translations as you code:
Full documentation, including guides, examples, and API references, can be found in the docs.
Create an API key at generaltranslation.com!
Join our Discord community to get help and stay updated!
- Just wrap your content in a
<T>
component! - No need for complex refactoring or managing JSON files.
export default function Page() {
return (
<T>
<p>You can write any JSX as children of the {'<T>'} component.</p>
<p>
For example, you could write a <a href='/'>link</a> and have the text be
translated in context.
</p>
<div>
<div>
<p>Even deeply nested components are translated in context.</p>
<button>Click me!</button>
</div>
</div>
</T>
);
}
- GT libraries also support the same features as existing libraries like
next-intl
andreact-i18next
. - Features such as dictionaries, plurals, currencies, and automatic routing are all supported.
- Setup is simple and can be done in minutes.
- All GT libraries are open-source and work standalone.
- You can use your own translation provider or use our free AI-powered translation service.
- No more managing translation keys like
t('menu.header.title')
.- Just write everything in-line!
- Translation hot reload in development
- Libraries integrate natively with our translation platform.
- Translations are generated for your app in seconds.
- HTML content is re-arranged and customized according to the language.
See the examples directory for some example projects that use our libraries. We currently support React and Next.js.
Simple interface for native pluralization and conditional logic:
<Plural
n={count}
singular={<>There is <Num>{count}</Num> item</>}
plural={<>There are <Num>{count}</Num> items</>}
/>
Support for translation at runtime:
export default function Comment() {
const comment = await getComment();
return (
<h1>Author: {comment.author}</h1>
<Tx>
<p>{comment.content}</p>
</Tx>
);
}
Intuitive i18n formatting syntax:
return (
<T>
<h1> Your account information: </h1>
Account balance: <Currency>{account.bal}</Currency> {/* Currency Formatting */}
<br />
Updated at: <DateTime>{account.updateTime}</DateTime> {/* Datetime Formatting */}
<br />
Transactions this month: <Num>{account.txCount}</Num> {/* Number Formatting */}
</T>
);
See the below for links to the relevant libraries:
- gt-next: Automatic i18n for Next.js
- gt-react: Automatic i18n for React
- generaltranslation: Core library for General Translation
- supported-locales: Currently supported locales
- gtx-cli: CLI tool for React apps
Any of the libraries can be installed via npm, yarn, pnpm, or bun.
For example, to install gt-next
:
npm install gt-next
yarn add gt-next
See our docs for more information.
We welcome any contributions to our libraries. Please submit a pull request!