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
2 changes: 1 addition & 1 deletion authors/archie.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ avatar: /static/avatars/archie.png
occupation: CEO
company: General Translation
email: archie@generaltranslation.com
twitter: https://x.com/archiemckenzie_/photo
twitter: https://x.com/archiemckenzie_
linkedin: https://www.linkedin.com/in/archie-mckenzie
---

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

```
```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
4 changes: 2 additions & 2 deletions devlog/en-US/gt-next_v6_10_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ export default async function Home() {

### The `locale` parameter requirement

Cached components use their parameters as cache keys, any cached component that contains translatable content must accept a `locale` parameter if they are to update when a user's locale changes. For example, `CachedContent` must accept a `locale` parameter to create separate cache entries for each locale. Without this parameter, the component would serve the same cached content regardless of the user's locale.
Cached components use their parameters as cache keys. Any cached component that contains translatable content must accept a `locale` parameter if they are to update when a user's locale changes. For example, `CachedContent` must accept a `locale` parameter to create separate cache entries for each locale. Without this parameter, the component would serve the same cached content regardless of the user's locale.

### Configuration notes

When `experimentalLocaleResolution` is enabled:
- I18n proxy must be enabled for locale resolution to work (see [I18n Proxy](/docs/next/guides/middleware))
- It overrides any custom `getLocale` functions (locale resolution happens from the reading the URL path)
- It overrides any custom `getLocale` functions (locale resolution happens from reading the URL path)
- It disables `getRegion` and `getDomain` functions
- It conflicts with the deprecated `experimentalEnableSSG` configuration - only one can be enabled at a time
- You can customize the locale parameter name with `experimentalLocaleResolutionParam` (defaults to `'locale'`)
Expand Down
4 changes: 2 additions & 2 deletions devlog/en-US/gt-next_v6_2_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export default function Page() {
We deliberately kept `gt()` synchronous to match other i18n libraries.
The downside was a `two-step translation process`:

1. Register the text with the API.
2. Wait for a second render to display the translated result.
1. Register the text with the API.
2. Wait for a second render to display the translated result.

Now, thanks to the compiler, translatable content is scanned ahead of time and passed directly into `useGT()` or `getGT()` at compile time.
This means translations are immediately available at runtime — no page refreshes.
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
1 change: 1 addition & 0 deletions docs/en-US/api/branches/getBranchInfo.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Get branch information
description: Get information about a branch, including its files and status.
full: true
_openapi:
method: POST
Expand Down
1 change: 1 addition & 0 deletions docs/en-US/api/context/getContextStatus.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Get context generation job status
description: Get the status of a context generation job.
full: true
_openapi:
method: GET
Expand Down
1 change: 1 addition & 0 deletions docs/en-US/api/context/shouldGenerateContext.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Check if context generation is needed
description: Check whether context generation is needed for the project.
full: true
_openapi:
method: GET
Expand Down
1 change: 1 addition & 0 deletions docs/en-US/api/files/getTranslationStatus.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Get translation status for a file
description: Get the translation status for a specific file.
full: true
_openapi:
method: GET
Expand Down
1 change: 1 addition & 0 deletions docs/en-US/api/jobs/getJobsInfo.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Get translation job status
description: Get the status of a translation job.
full: true
_openapi:
method: POST
Expand Down
1 change: 1 addition & 0 deletions docs/en-US/api/project/getProjectInfo.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Get project information
description: Get information about a project.
full: true
_openapi:
method: GET
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
3 changes: 1 addition & 2 deletions docs/en-US/core/locales.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,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
Technically, the library supports any validly constructed tag, including private use codes with no widely recognized meaning.

### Equivalent locale tags

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/key-concepts/dynamic-content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function Greeting(name) {
As far as translation goes this has two benefits:
1. You do not have to create a translation for every possible name.
* Using `<Var>`, we only generate one translation that essentially would look like this:
* \`¡Hola, $\{name\}!\`
* `¡Hola, ${name}!`
* If we do not use `<Var>`, we would have to perform an on-demand translation for every unique name:
* "¡Hola, Alice!", "¡Hola, Bob!", "¡Hola, Charlie!", "¡Hola, David!", ...
2. You also don't have to worry about the names themselves changing into a translated form of their name: (i.e. "¡Hola, Alicia!", "¡Hola, Roberto!", ...).
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 @@ -71,7 +71,7 @@ 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 there is a delay while waiting for an on-demand translation to load.

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.
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/next/api/config/with-gt-config.mdx
Original file line number Diff line number Diff line change
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
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 @@ -52,7 +52,7 @@ 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 there is a delay while waiting for an on-demand translation to load.

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),
and only use on-demand translations, like `tx` and [`<Tx>`](/docs/next/api/components/tx), when necessary.
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
6 changes: 3 additions & 3 deletions docs/en-US/node/api/strings/msg.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Use `decodeMsg` to retrieve the original content.

## Decoding [#decodemsg]

To get back the original string, you need to decode it with [`decodeMsg`](#decodemsg)
To get back the original string, you need to decode it with [`decodeMsg`](#decodemsg).

```js
import { msg, decodeMsg } from 'gt-node';
Expand Down Expand Up @@ -61,7 +61,7 @@ This ensures fast load times for all locales, but it can only translate content

Once generated, translations are either (1) stored in the CDN or (2) stored in your app's build output, according to your configuration.
From there, the translated content is served to your users.
If a translation is not found, it will fallback to the original content.
If a translation is not found, it will fall back to the original content.

Make sure to follow the [deployment guide here](/docs/next/tutorials/quickdeploy).

Expand Down 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.
2 changes: 1 addition & 1 deletion docs/en-US/overview/faqs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For example, `en-US` is a locale code, which refers to the English language as s

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

Yes you can!
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).
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/overview/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ General Translation is trusted by incredible developer-first companies like
<a target="_blank" href="https://cursor.com">Cursor</a>,
<a target="_blank" href="https://cognition.ai">Cognition</a>,
and
<a target="_blank" href="https://clickhouse.com">Clickhouse</a>,
<a target="_blank" href="https://clickhouse.com">ClickHouse</a>,
in addition to world-class product companies like
<a target="_blank" href="https://ramp.com">Ramp</a>,
<a target="_blank" href="https://tryprofound.com">Profound</a>,
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/sanity/guides/serialization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The plugin converts Sanity documents to HTML for translation, then deserializes

## How serialization works

1. **Serialize**: `gt-sanity` converts document to HTML
1. **Serialize**: `gt-sanity` converts the document to HTML
2. **Translate**: HTML is sent to the General Translation API for translation. Content is re-arranged and re-formatted for the target locale.
3. **Deserialize**: `gt-sanity` parses translated HTML and merges it with the original document

Expand Down
Loading