diff --git a/authors/default.mdx b/authors/default.mdx index ea49a6325..1b0037782 100644 --- a/authors/default.mdx +++ b/authors/default.mdx @@ -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 diff --git a/authors/jackie.mdx b/authors/jackie.mdx index 2ac16548a..c99d07226 100644 --- a/authors/jackie.mdx +++ b/authors/jackie.mdx @@ -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 diff --git a/blog/en-US/gt-next.mdx b/blog/en-US/gt-next.mdx index 4f30479e2..7089c12ce 100644 --- a/blog/en-US/gt-next.mdx +++ b/blog/en-US/gt-next.mdx @@ -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 ``` @@ -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" ``` diff --git a/docs/en-US/cli/stage.mdx b/docs/en-US/cli/stage.mdx index 133e996d6..bc54f1571 100644 --- a/docs/en-US/cli/stage.mdx +++ b/docs/en-US/cli/stage.mdx @@ -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 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 to translate your project into. These will be appended to the locales specified in your `gt.config.json` file. | ### Configuration file diff --git a/docs/en-US/core/class/methods/locales/requires-translation.mdx b/docs/en-US/core/class/methods/locales/requires-translation.mdx index 88f35afd2..4f22a6c1e 100644 --- a/docs/en-US/core/class/methods/locales/requires-translation.mdx +++ b/docs/en-US/core/class/methods/locales/requires-translation.mdx @@ -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. --- diff --git a/docs/en-US/core/quickstart.mdx b/docs/en-US/core/quickstart.mdx index 6abc8693b..3a4fa4ed6 100644 --- a/docs/en-US/core/quickstart.mdx +++ b/docs/en-US/core/quickstart.mdx @@ -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'; diff --git a/docs/en-US/next/api/components/tx.mdx b/docs/en-US/next/api/components/tx.mdx index 9e8c23adb..2c4327af3 100644 --- a/docs/en-US/next/api/components/tx.mdx +++ b/docs/en-US/next/api/components/tx.mdx @@ -71,12 +71,12 @@ This means translation will be performed live. `` 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, `` 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, `` will return the original content. -Our advice is to translate everything you can at build time using [``](/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 [``](/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 `` and [`tx`](/docs/next/api/strings/tx) when necessary. Make sure to follow the [deployment guide here](/docs/next/tutorials/quickdeploy). diff --git a/docs/en-US/next/api/config/with-gt-config.mdx b/docs/en-US/next/api/config/with-gt-config.mdx index e04c04656..8b82c5fd6 100644 --- a/docs/en-US/next/api/config/with-gt-config.mdx +++ b/docs/en-US/next/api/config/with-gt-config.mdx @@ -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. Use `withGTConfig` to: @@ -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"] } ``` diff --git a/docs/en-US/next/api/strings/tx.mdx b/docs/en-US/next/api/strings/tx.mdx index 2f00e28df..85fba94aa 100644 --- a/docs/en-US/next/api/strings/tx.mdx +++ b/docs/en-US/next/api/strings/tx.mdx @@ -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 [``](/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 [``](/docs/next/api/components/t), and only use on-demand translations, like `tx` and [``](/docs/next/api/components/tx), when necessary. Make sure to follow the [deployment guide here](/docs/next/tutorials/quickdeploy). diff --git a/docs/en-US/next/guides/local-tx.mdx b/docs/en-US/next/guides/local-tx.mdx index de5e9e040..9388e5eb9 100644 --- a/docs/en-US/next/guides/local-tx.mdx +++ b/docs/en-US/next/guides/local-tx.mdx @@ -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: diff --git a/docs/en-US/next/guides/migration.mdx b/docs/en-US/next/guides/migration.mdx index a7af6c92c..dfe00b057 100644 --- a/docs/en-US/next/guides/migration.mdx +++ b/docs/en-US/next/guides/migration.mdx @@ -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. diff --git a/docs/en-US/node/api/strings/msg.mdx b/docs/en-US/node/api/strings/msg.mdx index 88c5fb320..52c1f9393 100644 --- a/docs/en-US/node/api/strings/msg.mdx +++ b/docs/en-US/node/api/strings/msg.mdx @@ -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). @@ -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. diff --git a/docs/en-US/node/guides/strings.mdx b/docs/en-US/node/guides/strings.mdx index 877797ae0..c579f8d6a 100644 --- a/docs/en-US/node/guides/strings.mdx +++ b/docs/en-US/node/guides/strings.mdx @@ -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'; diff --git a/docs/en-US/python/guides/strings.mdx b/docs/en-US/python/guides/strings.mdx index d20e93d59..1b5eff64d 100644 --- a/docs/en-US/python/guides/strings.mdx +++ b/docs/en-US/python/guides/strings.mdx @@ -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') diff --git a/docs/en-US/react-native/api/components/gtprovider.mdx b/docs/en-US/react-native/api/components/gtprovider.mdx index e73d5d80e..670eeda78 100644 --- a/docs/en-US/react-native/api/components/gtprovider.mdx +++ b/docs/en-US/react-native/api/components/gtprovider.mdx @@ -234,7 +234,7 @@ In this case, it will return the fallback content immediately until the translat ## Notes -- The `` must wrap all [`` components](/docs/react-native/api/components/t) and other translation-related functions. Learn more [here](/docs/react-native/api/components/gtprovider). +- The `` must wrap all [`` components](/docs/react-native/api/components/t) and other translation-related functions. ## Next steps