Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions authors/default.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Team
avatar: /static/avatars/logo.png
occupation: Team
company: General Translation
email: archie@generaltranslation.com
twitter: https://x.com/generaltxn
Expand Down
1 change: 1 addition & 0 deletions authors/jackie.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Jackie Chen
avatar: /static/avatars/jackie.png
occupation: Software Engineer
company: General Translation
email: jackie@generaltranslation.com
twitter: https://x.com/Some_Jackie
Expand Down
12 changes: 6 additions & 6 deletions blog/en-US/gt-next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags: ['guide', 'internationalization', 'nextjs', 'gt-next']

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

``` copy
```bash copy
npm i gt-next
```

Expand Down Expand Up @@ -40,9 +40,9 @@ The goal with gt-next is to create an abundance mindset around translations. The
- Get an API key 🔐 on our [platform](https://generaltranslation.com)
- Read the [docs](https://generaltranslation.com/docs) 📄

### What you can do with gt-next
## What you can do with gt-next

#### Format variables and plurals
### Format variables and plurals

```javascript copy
import { T } from 'gt-next'
Expand All @@ -67,14 +67,14 @@ export default function Page() {
}
```

#### Use a developer API key to see translations locally
### Use a developer API key to see translations locally

```.env copy
```bash copy
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.
### Support over 100 languages out of the box, with on-demand translation.

![landing](/images/blogs/landing.png)

Expand Down
1 change: 0 additions & 1 deletion blog/en-US/i18n-without-translation-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ authors: [jackie]
tags: ['guide', 'internationalization', 'nextjs', 'i18n', 'gt-next', 'translation-files', 'developer-experience']
---

import Video from '@/components/Video';

Everyone who's internationalized a JavaScript app knows the workflow. You install an i18n library, create an `en.json` file, pull every user-facing string out of your components, assign each one a key, and reference the key where the string used to be. Then you duplicate that JSON file for every language you support. `es.json`, `fr.json`, `ja.json`.

Expand Down
4 changes: 2 additions & 2 deletions blog/en-US/multilingual-nextjs-seo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Search engines need separate, crawlable URLs to index each language version inde

This means **locale-in-the-URL** — not cookies, not query parameters, not `Accept-Language` detection alone.

```
```text
✅ generaltranslation.com/en/about
✅ generaltranslation.com/fr/about
✅ generaltranslation.com/es/about
Expand All @@ -46,7 +46,7 @@ This means **locale-in-the-URL** — not cookies, not query parameters, not `Acc

First, nest your pages under a `[locale]` dynamic segment:

```
```text
app/
└── [locale]/
├── layout.tsx
Expand Down
6 changes: 3 additions & 3 deletions blog/en-US/plurals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ layout: PostLayout

We often encounter apps that display awkward messages like:

```
```text
You have 1 new message(s)
```

Expand Down Expand Up @@ -168,7 +168,7 @@ languages like Arabic and Polish have more than just these two forms.

For example, an English-speaking user might expect:

```
```text
"No one is watching"
"1 person is watching"
"2 people are watching"
Expand All @@ -177,7 +177,7 @@ For example, an English-speaking user might expect:
Whereas an Arabic-speaking user might expect different expressions for singular,
dual (when the count is exactly two things), and small and large plural forms:

```
```text
"لا أحد يشاهد"
"1 شخص يشاهد"
"2 شخصان يشاهدان"
Expand Down
2 changes: 1 addition & 1 deletion devlog/en-US/gt-next_v6_3_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function Page() {

To support interpolation, the `msg()` function returns an encoded message instead of a plain string. The format looks like this:

```
```text
<interpolated content>:<base64 encoded string>
```

Expand Down
1 change: 0 additions & 1 deletion devlog/en-US/gt-react_v10_15_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ authors: [ernest]
tags: ['gt-react', 'derive', 'tagged-template', 'i18n']
---

import Video from '@/components/Video';

## The `declareStatic()` → `derive()` rename

Expand Down
1 change: 0 additions & 1 deletion devlog/en-US/gt-react_v10_19_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ authors: [ernest]
tags: ['gt-react', 'browser', 'hot-reload', 'dev-experience', 'i18n']
---

import Video from '@/components/Video';

<Video src='https://assets.gtx.dev/devlogs/gt-react-browser-tx-hot-reload.mp4' />

Expand Down
1 change: 0 additions & 1 deletion devlog/en-US/react-core-linter_v0_1_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ tags: ['react-core-linter', '0.1.0', 'eslint', 'linting', 'static-validation']

This plugin catches common implementation errors that we have seen in the wild.

import Video from '@/components/Video';

<Video src='https://assets.gtx.dev/docs/react-core-linter/web-0.1.0.mp4' />

Expand Down
10 changes: 5 additions & 5 deletions docs/en-US/cli/faqs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ title: FAQs
description: Frequently asked questions about the GT CLI tool
---

### Do I need an API key to use the CLI?
## Do I need an API key to use the CLI?

The [`translate`](/docs/cli/translate) command requires a production API key, which you can get for free at [generaltranslation.com](https://generaltranslation.com). The [`init`](/docs/cli/init) command can generate one for you during setup.

### When should I run `gt translate`?
## When should I run `gt translate`?

Run it in your CI/CD pipeline **before** building your app for production. It should not be used during development — in development, use development API keys for on-demand translation instead.

### Can I use the CLI with libraries other than gt-next and gt-react?
## Can I use the CLI with libraries other than gt-next and gt-react?

Yes. The CLI can generate translations for third-party i18n libraries like [next-intl](https://next-intl.dev/) and [i18next](https://react.i18next.com/). It can also translate standalone JSON, Markdown, MDX, JS, and TS files.

### What file formats does the CLI support?
## What file formats does the CLI support?

The CLI supports [JSON](/docs/cli/formats/json), [MDX](/docs/cli/formats/mdx), [HTML](/docs/cli/formats/html), [TypeScript/JavaScript](/docs/cli/formats/ts), [YAML](/docs/cli/formats/yaml), [PO/POT](/docs/cli/formats/po), [plain text](/docs/cli/formats/txt), and [GT's internal format](/docs/cli/formats/gt).

### Where do the translations go?
## Where do the translations go?

Depending on your configuration, translations are either uploaded to the GT CDN or saved locally in your project bundle. See [`save-local`](/docs/cli/save-local) for details on storing translations locally.
2 changes: 1 addition & 1 deletion docs/en-US/cli/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Here is a skeleton of the `gt.config.json` file:

In the case you want to alias a locale (e.g. `cn` instead of `zh`), you can specify a custom mapping in the `gt.config.json` file.

```json title="gt.config.json"
```jsonc title="gt.config.json"
{
"customMapping": {
// The alias locale
Expand Down
3 changes: 0 additions & 3 deletions docs/en-US/core/class/methods/formatting/format-date-time.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,3 @@ console.log(gt.formatDateTime(date, {
* See [`formatMessage`](/docs/core/class/methods/formatting/format-message) for message formatting with date interpolation
* See standalone [`formatDateTime`](/docs/core/functions/formatting/format-date-time) for use without GT instance
* See [`getLocaleProperties`](/docs/core/class/methods/locales/get-locale-properties) for locale-specific calendar information

## Next steps

2 changes: 1 addition & 1 deletion docs/en-US/core/class/methods/translation/await-jobs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (result.complete) {

| Name | Type | Description |
|------|------|-------------|
| `enqueueResult` | [`EnqueueFilesResult`](/docs/core/types/enqueue-files-options) | The result object returned by [`enqueueFiles`](/docs/core/class/methods/translation/enqueue-files) |
| `enqueueResult` | [`EnqueueFilesResult`](/docs/core/class/methods/translation/enqueue-files) | The result object returned by [`enqueueFiles`](/docs/core/class/methods/translation/enqueue-files) |
| `options?` | `AwaitJobsOptions` | Optional polling configuration |

#### AwaitJobsOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ console.log(`Setup initiated with job ID: ${setupResult.jobId}`);

// Monitor job status
const jobStatus = await gt.checkJobStatus([setupResult.jobId]);
console.log(`Job status: ${jobStatus.jobs[0].status}`);
console.log(`Job status: ${jobStatus[0].status}`);
```

---
Expand Down
1 change: 0 additions & 1 deletion docs/en-US/core/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ description: Overview of the generaltranslation library
The `generaltranslation` library serves as GT's core i18n library housing utility functions and classes for translation and formatting.
It is often used with framework packages like `gt-next` and `gt-react`, but can be used as a standalone library.

import Video from '@/components/Video';

<Video src='https://assets.gtx.dev/core-demo.mp4' />

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/core/locales.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Together, `zh-Hant-HK` means "Chinese, written in traditional characters, as spo
See the [list of supported locales](/docs/platform/supported-locales) for a searchable list of all locales currently supported by General Translation.

Technically, the library supports any validly constructed tag, including private use codes with no widely recognized meaning.
However, the platform will only translate
However, the platform will only translate locales that appear in the supported locales list.

### Equivalent locale tags

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/core/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ In order to translate a file, you need to follow these four steps:
### 1. Upload the file

Uploading files returns a list of file references with the [`uploadSourceFiles`](/docs/core/class/methods/translation/upload-source-files) method.
This allows you to later check the enqueue the file for translation, check the status of the file, and download the translated file.
This allows you to later enqueue the file for translation, check the status of the file, and download the translated file.

```typescript title="src/index.ts"
import fs from 'fs';
Expand Down
20 changes: 10 additions & 10 deletions docs/en-US/locadex/mintlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ Locadex:
- Translates markdown files, code blocks, and snippets in context
- Continuously translates as you push new content

### Step 1: Sign into the General Translation Dashboard
## Step 1: Sign into the General Translation Dashboard

Sign into the General Translation [Dashboard](https://dash.generaltranslation.com).

![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/1.png)

### Step 2: Connect GitHub
## Step 2: Connect GitHub

Navigate to the [Locadex](https://dash.generaltranslation.com) section in your dashboard and click "Connect GitHub".

You'll be redirected to GitHub to authorize the connection.

![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/2.png)

### Step 3: Install the GitHub app
## Step 3: Install the GitHub app

Choose which repositories to give Locadex access to:

![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/3.png)

Click "Install" to complete the GitHub app installation.

### Step 4: Link repository to project
## Step 4: Link repository to project

You'll be directed back to your General Translation project, where you can select the repository with your Mintlify docs.

![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/4.png)

### Step 5: Configure settings
## Step 5: Configure settings

On the configuration screen, set up:

Expand All @@ -53,31 +53,31 @@ On the configuration screen, set up:

![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/5.png)

### Step 6: Complete installation
## Step 6: Complete installation

Click "Install" to activate Locadex for your repository:

![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/6.png)

### Step 7: Review the PR
## Step 7: Review the PR

Locadex will create a pull request on your main branch. This may take a few minutes to complete.

![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/7.png)

Review the PR and merge it to complete your i18n setup.

### Step 8: Continuous internationalization
## Step 8: Continuous internationalization

After the initial setup PR is merged, Locadex monitors your main branch for commits and updates translations as needed.

![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/8.png)

### Supported frameworks
## Supported frameworks

Currently, Locadex only supports Mintlify and [Next.js App router](/docs/locadex) apps.

### Troubleshooting
## Troubleshooting

When you have Locadex installed across multiple GitHub accounts or organizations, the dashboard will display a list of all of the accounts and organizations.
Connecting to an account or organization will link that account to your current GT org.
Expand Down
12 changes: 6 additions & 6 deletions docs/en-US/locadex/next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,39 @@ Locadex:
- Translates your app into as many languages as you need
- Continuously internationalizes and translates as you push new content

### Step 1: Sign into the General Translation Dashboard
## Step 1: Sign into the General Translation Dashboard

Go to your [Dashboard](https://dash.generaltranslation.com) and sign in to your account.

### Step 2: Connect GitHub
## Step 2: Connect GitHub

1. Navigate to the GitHub integration section in your dashboard
2. Click "Connect GitHub" to link your GitHub account
3. You'll be redirected to GitHub to authorize the connection

### Step 3: Install the GitHub app
## Step 3: Install the GitHub app

1. After connecting GitHub, you'll be redirected to install the Locadex GitHub app
2. Choose which repositories to give Locadex access to:
- Install on all repositories, or
- Select specific repositories
3. Click "Install" to complete the GitHub app installation

### Step 4: Link repository to project
## Step 4: Link repository to project

1. Back in your GT dashboard, select the repository you want to internationalize
2. This connects your repo to your translation settings and target languages
3. Only one repository can be linked to a project, but you can create multiple projects, each with a different repository

### Step 5: Configure settings
## Step 5: Configure settings

On the configuration screen, set up:

- **Target Languages**: Choose which locales to translate into

![Locadex installation screen](https://assets.gtx.dev/locadex-screenshots/locadex-installation.png)

### Step 6: Complete installation
## Step 6: Complete installation

1. Review your configuration settings
2. Click "Install" to activate Locadex for your repository
Expand Down
6 changes: 3 additions & 3 deletions docs/en-US/next/api/components/tx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ This means translation will be performed live.

`<Tx>` translates jsx at runtime.
This means that translations are performed live, so you can translate content that is only known at runtime.
The trade off is that there is a delay while waiting for an on-demand translation to load is significantly slower.
The trade-off is that waiting for an on-demand translation to load is significantly slower.

While loading, `<Tx>` will return undefined unless languages are similar (en-US vs en-GB), though this behavior can be customized with render settings.
If an error occurs, `<Tx>` will return the original content.

Our advice is to translate everything you can at build time using [`<T>`](/docs/next/api/components/t), [`getGT`](/docs/next/api/strings/use-gt), or [`useGT`](/docs/next/api/strings/use-gt),
Our advice is to translate everything you can at build time using [`<T>`](/docs/next/api/components/t), [`getGT`](/docs/next/api/strings/get-gt), or [`useGT`](/docs/next/api/strings/use-gt),
and only use on-demand translations, like `<Tx>` and [`tx`](/docs/next/api/strings/tx) when necessary.

Make sure to follow the [deployment guide here](/docs/next/tutorials/quickdeploy).
Expand Down Expand Up @@ -121,7 +121,7 @@ export default function DynamicGreeting(user) {
```

### With plurals
The `<T>` component also supports pluralization using the `<Plural>` component.
The `<Tx>` component also supports pluralization using the `<Plural>` component.

```jsx title="ItemCount.jsx" copy
import { Tx, Plural } from 'gt-next/server';
Expand Down
2 changes: 0 additions & 2 deletions docs/en-US/next/api/middleware/create-next-middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,3 @@ If you set this to `false` (which is the default), then only the default locale

## Notes
* The `createNextMiddleware` function is a utility function that creates a proxy/middleware function for use with Next.js. Place it in `proxy.ts` in your project root.

## Next steps
2 changes: 1 addition & 1 deletion docs/en-US/next/api/strings/get-gt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default async function TranslateGreeting() {

## Notes
* The `getGT` function is a server-side function that translates strings.
* Translations strings with `getGT` happen before runtime, during the build process (unless in development).
* Translating strings with `getGT` happen before runtime, during the build process (unless in development).

## Next steps
* See [`useGT`](/docs/next/api/strings/use-gt) for client-side string translations at buildtime.
Expand Down
Loading
Loading