Skip to content
Open
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: 0 additions & 2 deletions blog/en-US/i18n-without-translation-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +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`.

At first, it's fine. Thirty strings, three languages, 90 entries.
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.

```
```txt
✅ 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:

```
```txt
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:

```
```txt
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:

```
```txt
"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:

```
```txt
"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:

```
```txt
"لا أحد يشاهد"
"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
2 changes: 0 additions & 2 deletions devlog/en-US/gt-react_v10_15_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ 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.
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: 0 additions & 2 deletions devlog/en-US/gt-react_v10_19_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +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' />

## Overview
Expand Down
2 changes: 0 additions & 2 deletions devlog/en-US/react-core-linter_v0_1_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +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' />

## Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/cli/formats/gt.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: GT JSX
title: GT
description: Automatically translate your gt-next, gt-react, or gt-react-native project
---

Expand Down
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

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ console.log(gt.isSameLanguage('en', 'en-US', 'en-GB')); // true
- Compares only the base language code (before first hyphen)
- Ignores regional, script, and variant differences
- Essential for language-based content organization
- Works with variable number of locale parameters
- Works with a variable number of locale parameters

## Next steps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: API reference for the requiresTranslation function

## Overview

The `requiresTranslation` function determines whether translation is needed between source and target locales without requiring a GT class instance.
The `requiresTranslation` function determines whether translation is needed between source and target locales, considering the approved locale list, without requiring a GT class instance.

---

Expand Down
2 changes: 0 additions & 2 deletions docs/en-US/core/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +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' />

```typescript title="index.ts"
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
2 changes: 1 addition & 1 deletion docs/en-US/locadex/auto-merge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Click the rule blocking auto-merge, then:
1. Click "Add Bypass"
2. Select "Locadex Agent" from the dropdown

![Add Bypass button with "Locadex Agent selected"](https://assets.gtx.dev/locadex-screenshots/auto-merge/add-bypass.png)
![Add Bypass button with "Locadex Agent" selected](https://assets.gtx.dev/locadex-screenshots/auto-merge/add-bypass.png)

### Step 4: Save changes

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/locadex/mintlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ After the initial setup PR is merged, Locadex monitors your main branch for comm

### Supported frameworks

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

### Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/next-lint/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: ESLint plugin for gt-next components.
---

<Callout type="warn">
This is in alpha. Subject to changes.
This is in alpha. Subject to change.
</Callout>

ESLint plugin that catches common translation errors in gt-next components.
Expand Down
6 changes: 3 additions & 3 deletions docs/en-US/next/api/config/with-gt-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default withGTConfig(nextConfig, {
**Legacy**

`initGT` is the legacy way to configure the `gt-next` library. It returns a function callback which is then called on the `NextConfig` object.
The props for both functions are the same, with the exception that `withGTProps` requires `NextConfig` to also be passed in.
The props for both functions are the same, with the exception that `withGTConfig` requires `NextConfig` to also be passed in.
</Callout>

Use `withGTConfig` to:
Expand Down Expand Up @@ -90,7 +90,7 @@ See the [gt.config.json](/docs/next/api/config/gt-config-json) reference for mor
| Prop | Description |
|----------------|-----------------------------------------------------------------------------|
| `defaultLocale`| Default locale for the application. English will be the fallback language when none is specified. |
| `locales` | An exclusive list of supported locales for the application. If a non-supported request is received will reroute to the browser's next-preferred language in the list. Will fallback to `defaultLocale` if no matches can be found. |
| `locales` | An exclusive list of supported locales for the application. If a non-supported request is received, it will reroute to the browser's next-preferred language in the list. Will fallback to `defaultLocale` if no matches can be found. |
| `description` | A natural language description of the site, used to aid translation. |

### Advanced props
Expand Down Expand Up @@ -254,7 +254,7 @@ export default withGTConfig(nextConfig, {
## Notes
* `withGTConfig` integrates GT translation functionality into your Next.js app and must be used in the root configuration file.
* Parameters like `apiKey` and `projectId` can be set directly in the configuration or as environment variables.
* Advanced parameters like `renderSettings` and `_batchInterval` allow fine-grained control over translation behavior and performance.
* Advanced parameters like `renderSettings` and `batchInterval` allow fine-grained control over translation behavior and performance.

## Next steps
* Add [translation to your CD process](/docs/next/tutorials/quickdeploy).
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ You can remove the default locale prefix by setting the `prefixDefaultLocale` op

```js title="proxy.ts" copy
export default createNextMiddleware({
prefixDefaultLocale: true,
prefixDefaultLocale: false,
});
```

Expand Down
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).
* Strings translated 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
1 change: 0 additions & 1 deletion docs/en-US/next/guides/local-tx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,3 @@ export default async function loadTranslations(locale: string) {

- [Middleware Guide](/docs/next/guides/middleware) - Language detection and routing
- [Languages Guide](/docs/next/guides/languages) - Configure supported languages
- API References:
2 changes: 1 addition & 1 deletion docs/en-US/next/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ That's it — your app is now multilingual. 🎉
<T context="the technology company">Apple</T>
```

Both `<T>`, `useGT()`, and `getGT()` support the `context` option.
All of `<T>`, `useGT()`, and `getGT()` support the `context` option.
</Accordion>
</Accordions>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Just copy and paste the following code into the `src/app/page.tsx` file and `src


Don't worry too much about how it works for now.
All this code does is simulate a fetch to a currency exchange API and displays the exchange rate between two currencies.
All this code does is simulate a fetch to a currency exchange API and display the exchange rate between two currencies.

<Tabs items={['layout.tsx', 'page.tsx']}>
<Tab value="page.tsx">
Expand Down
6 changes: 3 additions & 3 deletions docs/en-US/next/tutorials/examples/next-speedrun.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In total, this should take less than 10 minutes.

## Prerequisites

We assume that you either have experience using React in some capacity and are familiar with TypeScript.
We assume that you have experience using React in some capacity and are familiar with TypeScript.

---

Expand Down Expand Up @@ -42,7 +42,7 @@ npm i gt
## Step 3: Add your environment variables.

Navigate to the [Dashboard](https://generaltranslation.com/en-US/signin).
Go to the Dev Api Keys page on the nav bar and create a new API key and Project ID.
Go to the Dev API Keys page on the nav bar and create a new API key and Project ID.
Then add them to your `.env` file.

```bash copy
Expand Down Expand Up @@ -116,7 +116,7 @@ If you have set up everything correctly, you should see your app in the language
**Browser Cookies**

Check your browser's cookies for your app.
General translation uses cookies to store the user's language preference.
General Translation uses cookies to store the user's language preference.
The cookie is called `generaltranslation.locale`, and all you need to do is delete it.
It will be under `localhost:3000`.
Then, just double-check you are using the desired preferred language and then
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).
* Strings translated with `msg` happen before runtime, during the build process (unless in development).

## Next steps
* See [`getMessages`](/docs/node/api/get-messages) for resolving translated strings at runtime.
2 changes: 1 addition & 1 deletion 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
2 changes: 0 additions & 2 deletions docs/en-US/react-core-linter/guides/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ 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' />

## Installation
Expand Down
2 changes: 0 additions & 2 deletions docs/en-US/react-core-linter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ 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' />

## Rules
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/react-native/api/components/gtprovider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default function App() {

### Render settings

Render settings controls the loading behavior for translations.
Render settings control the loading behavior for translations.
There are two fields: `timeout` and `method`.

- `timeout` is the number of milliseconds to wait for a translation to load before showing a fallback (default: `8000ms`).
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/react/api/components/gtprovider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ createRoot(document.getElementById("root")!).render(

### Render settings

Render settings controls the loading behavior for translations.
Render settings control the loading behavior for translations.
There are two fields: `timeout` and `method`.

- `timeout` is the number of milliseconds to wait for a translation to load before showing a fallback (default: `8000ms`).
Expand Down
Loading