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
4 changes: 2 additions & 2 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 @@ -69,7 +69,7 @@ export default function Page() {

#### 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"
```
Expand Down
8 changes: 4 additions & 4 deletions docs/en-US/cli/stage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ There are a few key parameters:

| Parameter | Description |
|-----------------|--------------------------------------------------|
| `--dry-run` | This flag will cause the CLI to parse and validate your project, but will not communicate with the GT API. This is useful for validating your codebase.
| `--api-key` | Unless you are using `--dry-run`, you must provide a production API key.
| `--project-id` | Similarly, unless you are using `--dry-run`, you must provide a project ID.
| `--new, --locales <locales>` | Locales to translate your project into. These will be appended to the locales specified in your `gt.config.json` file.
| `--dry-run` | This flag will cause the CLI to parse and validate your project, but will not communicate with the GT API. This is useful for validating your codebase. |
| `--api-key` | Unless you are using `--dry-run`, you must provide a production API key. |
| `--project-id` | Similarly, unless you are using `--dry-run`, you must provide a project ID. |
| `--new, --locales <locales>` | Locales to translate your project into. These will be appended to the locales specified in your `gt.config.json` file. |

### Configuration file

Expand Down
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
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
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 on-demand translation is significantly slower, as there is a delay while waiting for it 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.

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/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 @@ -230,7 +230,7 @@ If the translation takes longer than 8 seconds, the method will time out and ren
```json title="gt.config.json"
{
"defaultLocale": "en-US",
"locales": ["en-US", "es", "fr"],
"locales": ["en-US", "es", "fr"]
}
```

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 on-demand translation is significantly slower, as there is a delay while waiting for it 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),
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
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/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
4 changes: 2 additions & 2 deletions docs/en-US/node/api/strings/msg.mdx
Original file line number Diff line number Diff line change
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/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
4 changes: 2 additions & 2 deletions docs/en-US/python/guides/strings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ message = t('You have {count} {item}.', count=count, item=item_word)

See the [derive tutorial](/docs/python/tutorials/derive) for more patterns.

## Using `$context` for disambiguation
## Using `_context` for disambiguation

Ambiguous strings can produce inaccurate translations. Add `$context` to guide the translator:
Ambiguous strings can produce inaccurate translations. Add `_context` to guide the translator:

```python
t('Apple', context='the technology company')
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 @@ -234,7 +234,7 @@ In this case, it will return the fallback content immediately until the translat

## Notes

- The `<GTProvider>` must wrap all [`<T>` components](/docs/react-native/api/components/t) and other translation-related functions. Learn more [here](/docs/react-native/api/components/gtprovider).
- The `<GTProvider>` must wrap all [`<T>` components](/docs/react-native/api/components/t) and other translation-related functions.

## Next steps

Expand Down
Loading