diff --git a/authors/archie.mdx b/authors/archie.mdx index b64acf16..b4504c22 100644 --- a/authors/archie.mdx +++ b/authors/archie.mdx @@ -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 --- diff --git a/authors/default.mdx b/authors/default.mdx index ea49a632..1b003778 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 2ac16548..c99d0722 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 4f30479e..eeaa8ea9 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 ``` diff --git a/blog/en-US/multilingual-nextjs-seo.mdx b/blog/en-US/multilingual-nextjs-seo.mdx index b019428a..1ac2d899 100644 --- a/blog/en-US/multilingual-nextjs-seo.mdx +++ b/blog/en-US/multilingual-nextjs-seo.mdx @@ -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 @@ -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 diff --git a/blog/en-US/plurals.mdx b/blog/en-US/plurals.mdx index 02b1af42..b8371501 100644 --- a/blog/en-US/plurals.mdx +++ b/blog/en-US/plurals.mdx @@ -12,7 +12,7 @@ layout: PostLayout We often encounter apps that display awkward messages like: -``` +```text You have 1 new message(s) ``` diff --git a/devlog/en-US/gt-next_v6_3_0.mdx b/devlog/en-US/gt-next_v6_3_0.mdx index ce7567e9..9ea11079 100644 --- a/devlog/en-US/gt-next_v6_3_0.mdx +++ b/devlog/en-US/gt-next_v6_3_0.mdx @@ -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 : ``` diff --git a/devlog/en-US/gt-react_v10_18_0.mdx b/devlog/en-US/gt-react_v10_18_0.mdx index 397ef4ab..7fde2e46 100644 --- a/devlog/en-US/gt-react_v10_18_0.mdx +++ b/devlog/en-US/gt-react_v10_18_0.mdx @@ -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" ``` diff --git a/docs/en-US/cli/faqs.mdx b/docs/en-US/cli/faqs.mdx index 32e9381b..18d25431 100644 --- a/docs/en-US/cli/faqs.mdx +++ b/docs/en-US/cli/faqs.mdx @@ -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. diff --git a/docs/en-US/cli/stage.mdx b/docs/en-US/cli/stage.mdx index 133e996d..6c414749 100644 --- a/docs/en-US/cli/stage.mdx +++ b/docs/en-US/cli/stage.mdx @@ -78,7 +78,7 @@ There are a few key parameters: ### Configuration file -When running `gt stage`, the CLI will automatically add the `stageTranslations : true` property to your `gt.config.json` file. +When running `gt stage`, the CLI will automatically add the `stageTranslations: true` property to your `gt.config.json` file. This property ensures that if `translate` is run without first running `stage` for a specific deployment version, the CLI tool will error and exit. diff --git a/docs/en-US/core/quickstart.mdx b/docs/en-US/core/quickstart.mdx index 6abc8693..3a4fa4ed 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 9e8c23ad..a9195b35 100644 --- a/docs/en-US/next/api/components/tx.mdx +++ b/docs/en-US/next/api/components/tx.mdx @@ -71,7 +71,7 @@ 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 waiting for an on-demand translation to load is significantly slower. 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. @@ -121,7 +121,7 @@ export default function DynamicGreeting(user) { ``` ### With plurals -The `` component also supports pluralization using the `` component. +The `` component also supports pluralization using the `` component. ```jsx title="ItemCount.jsx" copy import { Tx, Plural } from 'gt-next/server'; 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 e04c0465..65de0653 100644 --- a/docs/en-US/next/api/config/with-gt-config.mdx +++ b/docs/en-US/next/api/config/with-gt-config.mdx @@ -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). diff --git a/docs/en-US/next/api/strings/tx.mdx b/docs/en-US/next/api/strings/tx.mdx index 2f00e28d..627abd86 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 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 [``](/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/cache-components.mdx b/docs/en-US/next/guides/cache-components.mdx index 6a39f2ec..289da5e5 100644 --- a/docs/en-US/next/guides/cache-components.mdx +++ b/docs/en-US/next/guides/cache-components.mdx @@ -71,7 +71,7 @@ export const config = { matcher: ['/((?!api|static|.*\\..*|_next).*)'] }; -```` +``` ### Add the `locale` parameter to cached components with translatable content diff --git a/docs/en-US/next/guides/dictionaries.mdx b/docs/en-US/next/guides/dictionaries.mdx index 3b81d06a..95da7359 100644 --- a/docs/en-US/next/guides/dictionaries.mdx +++ b/docs/en-US/next/guides/dictionaries.mdx @@ -116,8 +116,8 @@ async function MyServerComponent() { return (
-

{t('greetings.hello')}

-

{t('greetings.welcome')}

+

{d('greetings.hello')}

+

{d('greetings.welcome')}

); } diff --git a/docs/en-US/overview/ai-tools.mdx b/docs/en-US/overview/ai-tools.mdx index dde504ba..88a5da79 100644 --- a/docs/en-US/overview/ai-tools.mdx +++ b/docs/en-US/overview/ai-tools.mdx @@ -7,8 +7,6 @@ We provide several resources to help your AI tools work with General Translation ## llms.txt -### llms.txt - Provide your AI coding tools with our [llms.txt](/llms.txt) file for a brief summary of our docs in an LLM-friendly format. ### llms-full.txt diff --git a/docs/en-US/platform/supported-locales.mdx b/docs/en-US/platform/supported-locales.mdx index b4ab1255..b47759b1 100644 --- a/docs/en-US/platform/supported-locales.mdx +++ b/docs/en-US/platform/supported-locales.mdx @@ -3,7 +3,7 @@ title: Supported Locales description: A list of the locales currently supported by General Translation --- -## Search locales +## Search locales Below is a list of all the [locales](/docs/core/locales) currently supported by the General Translation platform. diff --git a/docs/en-US/react/faqs.mdx b/docs/en-US/react/faqs.mdx index 1414fb32..7debe995 100644 --- a/docs/en-US/react/faqs.mdx +++ b/docs/en-US/react/faqs.mdx @@ -3,17 +3,17 @@ title: FAQs description: Frequently asked questions about gt-react --- -### What happens if there are missing translations in production? +## What happens if there are missing translations in production? If a translation for some content is missing in production, gt-react automatically falls back to the original source text. Your app will still render correctly — users will just see the default language for that piece of content. -### Why do I have to install the CLI tool? +## Why do I have to install the CLI tool? The CLI tool parses the content inside all `` components and generates translations for that content in advance, so that all the translations are ready when your app is deployed to production. In development, you don't need it because you can use development API keys to translate on demand. -### Where does the `` component get its translations? +## Where does the `` component get its translations? `` can load translations from anywhere depending on how you've configured the library: - If you have a project ID, the library can hit a free CDN @@ -26,15 +26,15 @@ During development, the `` component hits an API which uses a small AI model In production, `` won't do this, so your API keys are never exposed to the client. -### Does AI translation work with dynamic content and variables? +## Does AI translation work with dynamic content and variables? The `` component doesn't support translating dynamic content and variables directly, because the translations could potentially change with every re-render. However, you can still include dynamic content inside a `` by wrapping it with ``, ``, or `` components. This is similar to how other libraries handle string interpolation. -### Can I deploy my app without depending on GT servers? +## Can I deploy my app without depending on GT servers? Yes. You can do the translations yourself, then load them from your own bundle or your own CDN. See the [loadTranslations docs](/docs/react/api/config/load-translations) for details on loading translations from local files. -### Why do I get `ReferenceError: TextEncoder is not defined` in Jest? +## Why do I get `ReferenceError: TextEncoder is not defined` in Jest? `jest-environment-jsdom` uses an older version of jsdom that doesn't include `TextEncoder`. GT libraries use it internally for hashing. This will resolve itself once Jest updates its jsdom dependency (newer jsdom versions already support `TextEncoder`), but in the meantime you can polyfill it with a setup file: @@ -52,6 +52,6 @@ Then add it to your Jest config: } ``` -### How do I migrate from react-intl or i18next? +## How do I migrate from react-intl or i18next? See the [migration guide](/docs/react/guides/migration) for step-by-step instructions on migrating from other i18n libraries.