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: General Translation
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
10 changes: 5 additions & 5 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
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
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
8 changes: 4 additions & 4 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 @@ -87,7 +87,7 @@ pluralize(2, 'child', 'children') // "children"

But what if you need more complicated logic, like:

```
```text
"No one is watching"
"1 person is watching"
"2 people are watching"
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
4 changes: 2 additions & 2 deletions devlog/en-US/gt-i18n_v0_1_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Though `generaltranslation` is also a runtime-agnostic library, it is—by desig

## What's Included

- **[`msg()`](#)** - String registration and variable interpolation
- **[`mFallback()`](#)** and **[`gtFallback()`](#)** - Migration helpers for incremental adoption
- **`msg()`** - String registration and variable interpolation
- **`mFallback()`** and **`gtFallback()`** - Migration helpers for incremental adoption

---

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
2 changes: 1 addition & 1 deletion devlog/en-US/gt-react_v10_18_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function StatusMessage({ isMasculine }) {

At build time, the CLI sees the `derive()` call and registers two separate source entries, each producing its own translation:

```
```text
"I am tired" ($context: "inflect as masculine") → "Estoy cansado"
"I am tired" ($context: "inflect as feminine") → "Estoy cansada"
```
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/cli/stage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ There are a few key parameters:

### Configuration file

When running `gt stage`, the CLI will automatically add the `stageTranslations : true` property to your `gt.config.json` file.
When running `gt stage`, the CLI will automatically add the `"stageTranslations": true` property to your `gt.config.json` file.

This property ensures that if `translate` is run without first running `stage` for a specific deployment version,
the CLI tool will error and exit.
Expand Down
2 changes: 0 additions & 2 deletions docs/en-US/core/class/methods/formatting/format-date-time.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,3 @@ console.log(gt.formatDateTime(date, {
* 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/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
10 changes: 5 additions & 5 deletions docs/en-US/locadex/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 Locadex
---

### What is Locadex?
## What is Locadex?

Locadex is an AI agent that automates internationalization and translation for your project. Once installed, it monitors your repository and keeps translations up to date as your code changes.

### How does Locadex integrate with my workflow?
## How does Locadex integrate with my workflow?

Locadex connects to your GitHub repository and can run automatically when it detects changes, or manually from the dashboard. It opens pull requests with translation updates that you can review before merging.

### Does Locadex work with monorepos?
## Does Locadex work with monorepos?

Yes. See the [monorepos guide](/docs/locadex/monorepos) for configuration details.

### What frameworks does Locadex support?
## What frameworks does Locadex support?

Locadex currently has guides for [Next.js](/docs/locadex/next) and [Mintlify](/docs/locadex/mintlify). It can also work with other setups that use the GT CLI.

### Can I control which translations Locadex updates?
## Can I control which translations Locadex updates?

Yes. You can configure Locadex through your project settings on the dashboard and use [auto-merge](/docs/locadex/auto-merge) settings to control how translation PRs are handled.
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
4 changes: 3 additions & 1 deletion docs/en-US/locadex/next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Locadex:
- Translates your app into as many languages as you need
- Continuously internationalizes and translates as you push new content

## Installation

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

Go to your [Dashboard](https://dash.generaltranslation.com) and sign in to your account.
Expand Down Expand Up @@ -74,7 +76,7 @@ After the initial setup is merged:

1. Locadex monitors your main or specified branch for pull requests
2. When you push new code with translatable content, wait for Locadex to add its commit to the PR
3. Once Locadex commits to the PR, it is safe to merge -- your new code is internationalized
3. Once Locadex commits to the PR, it is safe to merge your new code is internationalized
4. Your app stays translated without manual intervention

## Monitoring your repository
Expand Down
4 changes: 2 additions & 2 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 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
4 changes: 2 additions & 2 deletions docs/en-US/next/api/strings/tx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ A promise that resolves to a string containing the translated content, or the or

The `tx` function translates strings 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 is significantly slower.

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

Make sure to follow the [deployment guide here](/docs/next/tutorials/quickdeploy).
Expand Down
4 changes: 2 additions & 2 deletions docs/en-US/next/guides/dictionaries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ async function MyServerComponent() {

return (
<div>
<h1>{t('greetings.hello')}</h1>
<p>{t('greetings.welcome')}</p>
<h1>{d('greetings.hello')}</h1>
<p>{d('greetings.welcome')}</p>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/next/guides/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ You'll never have to wait for translations again.

1. Fully migrate your entire project to `gt-next`, and remove the old i18n library.
2. Fully migrate your project, but keep using dictionaries from the old i18n library.
2. Keep using the old i18n library for now, and only migrate part of your project to `gt-next`.
3. Keep using the old i18n library for now, and only migrate part of your project to `gt-next`.

For more details on each option, see the [migration strategies](#strategies) section.
</Step>
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/node/api/get-translations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Create a `dictionary.json` file in your project root:
}
```

When you run `npx gtx translate`, the CLI automatically detects `dictionary.json` and translates it for your configured locales.
When you run `npx gt translate`, the CLI automatically detects `dictionary.json` and translates it for your configured locales.

Then initialize GT with the dictionary:

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/node/api/strings/msg.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ console.log(translated);

## Notes
* The `msg` function is a function that marks strings for translation.
* Translations strings with `msg` happen before runtime, during the build process (unless in development).
* Translating strings with `msg` happens before runtime, during the build process (unless in development).

## Next steps
* See [`getMessages`](/docs/node/api/get-messages) for resolving translated strings at runtime.
4 changes: 2 additions & 2 deletions docs/en-US/node/guides/strings.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: String Translation Patterns
description: Two approaches to translating strings in Node.js — inline and pre-registered
description: Three approaches to translating strings in Node.js — inline, pre-registered, and on-demand
---

There are three ways to translate strings in `gt-node`:
Expand Down Expand Up @@ -38,7 +38,7 @@ gt('{city} weather: {temp}°F', { city: 'Tokyo', temp: 72 });

## Pre-registered strings with `msg()` / `getMessages()`

Use [`msg()`](/docs/node/api/get-messages) to register strings at module scope — outside of any request handler. Then use [`getMessages()`](/docs/node/api/get-messages) inside handlers to resolve them for the current locale:
Use [`msg()`](/docs/node/api/strings/msg) to register strings at module scope — outside of any request handler. Then use [`getMessages()`](/docs/node/api/get-messages) inside handlers to resolve them for the current locale:

```js title="messages.js"
import { msg } from 'gt-node';
Expand Down
6 changes: 3 additions & 3 deletions docs/en-US/overview/faqs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ title: FAQs
description: Frequently Asked Questions
---

### What is a locale?
## What is a locale?

A locale is **a language or dialect**.
For example, `en-US` is a locale code, which refers to the English language as spoken in the United States of America.

* [Read more about locales](/docs/core/locales)
* [List of supported locales](/docs/platform/supported-locales)

### Can I use the libraries without using the General Translation platform?
## Can I use the libraries without using the General Translation platform?

Yes you can!
General Translation internationalization libraries are free, open-source, and can be configured to fetch translations from any source.

Read the docs on how to load your own translations [here](/docs/next/api/config/load-translations).

### Section-specific FAQs
## Section-specific FAQs

- [Platform](/docs/platform/faqs)
- [Locadex AI Agent](/docs/locadex/faqs)
Expand Down
Loading
Loading