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/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
2 changes: 1 addition & 1 deletion 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
4 changes: 1 addition & 3 deletions blog/en-US/i18n-without-translation-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ 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`.

At first, it's fine. Thirty strings, three languages, 90 entries.

Then your app grows. Six months later you have 400 strings and 12 languages. 4,800 entries across a dozen files. A developer adds a new feature, writes five new strings, forgets to update three of the translation files. Nobody notices until a user in Tokyo sees English fallbacks in a Japanese interface. Someone suggests buying a translation management system.

<Video src='https://assets.gtx.dev/i18n-no-translation.mp4' />
[Watch the demo video](https://assets.gtx.dev/i18n-no-translation.mp4)

## The file management tax

Expand Down
4 changes: 1 addition & 3 deletions devlog/en-US/gt-react_v10_15_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ authors: [ernest]
tags: ['gt-react', 'derive', 'tagged-template', 'i18n']
---

import Video from '@/components/Video';

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

This release is the first to ship with the new `derive()` name. Previously, this function was called `declareStatic()` and the JSX component was `<Static>`. In [PR #1062](https://github.com/generaltranslation/gt/pull/1062), both were renamed to `derive()` and `<Derive>` for clarity.

<Video src='https://assets.gtx.dev/derive-animation.mp4' />
[Watch the demo video](https://assets.gtx.dev/derive-animation.mp4)

## Overview

Expand Down
4 changes: 1 addition & 3 deletions devlog/en-US/gt-react_v10_19_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ 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' />
[Watch the demo video](https://assets.gtx.dev/devlogs/gt-react-browser-tx-hot-reload.mp4)

## Overview

Expand Down
4 changes: 1 addition & 3 deletions devlog/en-US/react-core-linter_v0_1_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ 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' />
[Watch the demo video](https://assets.gtx.dev/docs/react-core-linter/web-0.1.0.mp4)

## Installation

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.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: API reference for the GT requiresTranslation method
## Overview

The `requiresTranslation` method determines whether translation is needed based on source and target locales.
It checks if the source content needs to be translated by comparing locale codes and considering approved locale list.
It checks if the source content needs to be translated by comparing locale codes and considering the approved locale list.

---

Expand Down
4 changes: 1 addition & 3 deletions docs/en-US/core/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ 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' />
[Watch the demo video](https://assets.gtx.dev/core-demo.mp4)

```typescript title="index.ts"
import { GT } from 'generaltranslation';
Expand Down
10 changes: 5 additions & 5 deletions docs/en-US/core/locales.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Locales can be general or specific. For example:
- `zh-Hant` is Chinese, written with traditional characters
- `zh-Hant-HK` is Chinese, written with traditional characters, as spoken in Hong Kong

### Constructing locale codes
## Constructing locale codes

General Translation uses the [BCP 47 Language Tag](https://www.techonthenet.com/js/language_tags.php) standard to define locale codes.
BCP 47 Language Tags are the Internet Best Current Practices (BCP) standard for identifying languages in both spoken and written forms.
Expand All @@ -37,14 +37,14 @@ For example, `zh-Hant-HK` is:

Together, `zh-Hant-HK` means "Chinese, written in traditional characters, as spoken in Hong Kong".

### List of supported locales [#supported-locales]
## List of supported locales [#supported-locales]

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

### Equivalent locale tags
## Equivalent locale tags

Sometimes, multiple locale tags are functionally equivalent.
For example, you could write:
Expand All @@ -55,7 +55,7 @@ For example, you could write:
The General Translation libraries and platform usually don't distinguish between these equivalent codes,
since translating between them is impossible.

### Commonly used locale codes
## Commonly used locale codes

| Locale code | Language | Script | Region | Description |
|---------------|-------------|---------------------|-----------------|-----------------------------------------------|
Expand All @@ -77,7 +77,7 @@ since translating between them is impossible.
| `pt-BR` | Portuguese | ― | Brazil | Portuguese as spoken in Brazil |
| `it` | Italian | ― | ― | Italian |

### Next steps
## Next steps

- See our [List of Supported Locales](/docs/platform/supported-locales) to find the language tags available in General Translation.
- Refer to the official [IETF Language Tag Registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
Expand Down
4 changes: 2 additions & 2 deletions docs/en-US/core/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We will cover string translation and file translation.
This is completely free, and will give you access to the translation services.


Navigate to the [`API Keys` page](https://dash.generaltranslation.com/api-keys) click `Create API Key`.
Navigate to the [`API Keys` page](https://dash.generaltranslation.com/api-keys) and click `Create API Key`.
Choose a name for your API key, and click `Create`.

![API key page](https://assets.gtx.dev/core/quickstart/core-quickstart-1.png)
Expand Down 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
2 changes: 1 addition & 1 deletion docs/en-US/next/api/components/tx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The trade off is that there is a delay while waiting for an on-demand translatio
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
2 changes: 1 addition & 1 deletion docs/en-US/next/api/strings/tx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ 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.

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
2 changes: 1 addition & 1 deletion docs/en-US/next/guides/cache-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const config = {
matcher: ['/((?!api|static|.*\\..*|_next).*)']
};

````
```
</Step>
<Step>
### Add the `locale` parameter to cached components with translatable content
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
1 change: 0 additions & 1 deletion docs/en-US/next/tutorials/dictionary/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ title: Setup
description: Set up a tutorial project
---

🚧 This section is currently under construction. 🚧

2 changes: 1 addition & 1 deletion docs/en-US/node/guides/strings.mdx
Original file line number Diff line number Diff line change
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
4 changes: 1 addition & 3 deletions docs/en-US/react-core-linter/guides/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ description: Quickstart guide for the React Core Linter
This is an ESLint plugin designed to be used with any of our i18n libraries, `gt-react`, `gt-next`, or `gt-react-native`.
It checks for common implementation errors and offers fixes.

import Video from '@/components/Video';

<Video src='https://assets.gtx.dev/docs/react-core-linter/web-0.1.0.mp4' />
[Watch the demo video](https://assets.gtx.dev/docs/react-core-linter/web-0.1.0.mp4)

## Installation

Expand Down
4 changes: 1 addition & 3 deletions docs/en-US/react-core-linter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ description: ESLint plugin for GT React libraries

It checks for issues like dynamic content inside `<T>` components and dynamic strings in translation functions, and offers autofixes.

import Video from '@/components/Video';

<Video src='https://assets.gtx.dev/docs/react-core-linter/web-0.1.0.mp4' />
[Watch the demo video](https://assets.gtx.dev/docs/react-core-linter/web-0.1.0.mp4)

## Rules

Expand Down
Loading
Loading