diff --git a/authors/default.mdx b/authors/default.mdx index ea49a6325..21ebb23a2 100644 --- a/authors/default.mdx +++ b/authors/default.mdx @@ -1,6 +1,7 @@ --- name: Team avatar: /static/avatars/logo.png +occupation: General Translation 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..3cfe83507 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 ``` @@ -40,9 +40,9 @@ The goal with gt-next is to create an abundance mindset around translations. The - Get an API key ๐Ÿ” on our [platform](https://generaltranslation.com) - Read the [docs](https://generaltranslation.com/docs) ๐Ÿ“„ -### What you can do with gt-next +## What you can do with gt-next -#### Format variables and plurals +### Format variables and plurals ```javascript copy import { T } from 'gt-next' @@ -67,14 +67,14 @@ export default function Page() { } ``` -#### Use a developer API key to see translations locally +### Use a developer API key to see translations locally ```.env copy GT_API_KEY="gtx-dev-cae62d6fe1e33bda603c9a2926ab0fb8" GT_PROJECT_ID="abcdef12-3456-789a-bcd4-ef123456789a" ``` -#### Support over 100 languages out of the box, with on-demand translation. +### Support over 100 languages out of the box, with on-demand translation. ![landing](/images/blogs/landing.png) diff --git a/blog/en-US/multilingual-nextjs-seo.mdx b/blog/en-US/multilingual-nextjs-seo.mdx index b019428ab..1ac2d8995 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 02b1af420..3f92952bc 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) ``` @@ -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" @@ -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" @@ -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 ุดุฎุตุงู† ูŠุดุงู‡ุฏุงู†" diff --git a/devlog/en-US/gt-i18n_v0_1_0.mdx b/devlog/en-US/gt-i18n_v0_1_0.mdx index 528ab2a2b..151a96931 100644 --- a/devlog/en-US/gt-i18n_v0_1_0.mdx +++ b/devlog/en-US/gt-i18n_v0_1_0.mdx @@ -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 --- diff --git a/devlog/en-US/gt-next_v6_3_0.mdx b/devlog/en-US/gt-next_v6_3_0.mdx index ce7567e97..9ea110790 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 397ef4ab3..7fde2e468 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/stage.mdx b/docs/en-US/cli/stage.mdx index 133e996d6..f4219d39e 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/class/methods/formatting/format-date-time.mdx b/docs/en-US/core/class/methods/formatting/format-date-time.mdx index 4f35d3910..e7369aaba 100644 --- a/docs/en-US/core/class/methods/formatting/format-date-time.mdx +++ b/docs/en-US/core/class/methods/formatting/format-date-time.mdx @@ -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 - 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/locadex/faqs.mdx b/docs/en-US/locadex/faqs.mdx index 61112e6f8..dd86cc202 100644 --- a/docs/en-US/locadex/faqs.mdx +++ b/docs/en-US/locadex/faqs.mdx @@ -3,22 +3,22 @@ title: FAQs description: Frequently asked questions about Locadex --- -### What is Locadex? +## What is Locadex? Locadex is an AI agent that automates internationalization and translation for your project. Once installed, it monitors your repository and keeps translations up to date as your code changes. -### How does Locadex integrate with my workflow? +## How does Locadex integrate with my workflow? Locadex connects to your GitHub repository and can run automatically when it detects changes, or manually from the dashboard. It opens pull requests with translation updates that you can review before merging. -### Does Locadex work with monorepos? +## Does Locadex work with monorepos? Yes. See the [monorepos guide](/docs/locadex/monorepos) for configuration details. -### What frameworks does Locadex support? +## What frameworks does Locadex support? Locadex currently has guides for [Next.js](/docs/locadex/next) and [Mintlify](/docs/locadex/mintlify). It can also work with other setups that use the GT CLI. -### Can I control which translations Locadex updates? +## Can I control which translations Locadex updates? Yes. You can configure Locadex through your project settings on the dashboard and use [auto-merge](/docs/locadex/auto-merge) settings to control how translation PRs are handled. diff --git a/docs/en-US/locadex/mintlify.mdx b/docs/en-US/locadex/mintlify.mdx index 09fba0e9f..a4c946eac 100644 --- a/docs/en-US/locadex/mintlify.mdx +++ b/docs/en-US/locadex/mintlify.mdx @@ -15,13 +15,13 @@ Locadex: - Translates markdown files, code blocks, and snippets in context - Continuously translates as you push new content -### Step 1: Sign into the General Translation Dashboard +## Step 1: Sign into the General Translation Dashboard Sign into the General Translation [Dashboard](https://dash.generaltranslation.com). ![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/1.png) -### Step 2: Connect GitHub +## Step 2: Connect GitHub Navigate to the [Locadex](https://dash.generaltranslation.com) section in your dashboard and click "Connect GitHub". @@ -29,7 +29,7 @@ You'll be redirected to GitHub to authorize the connection. ![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/2.png) -### Step 3: Install the GitHub app +## Step 3: Install the GitHub app Choose which repositories to give Locadex access to: @@ -37,13 +37,13 @@ Choose which repositories to give Locadex access to: Click "Install" to complete the GitHub app installation. -### Step 4: Link repository to project +## Step 4: Link repository to project You'll be directed back to your General Translation project, where you can select the repository with your Mintlify docs. ![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/4.png) -### Step 5: Configure settings +## Step 5: Configure settings On the configuration screen, set up: @@ -53,13 +53,13 @@ On the configuration screen, set up: ![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/5.png) -### Step 6: Complete installation +## Step 6: Complete installation Click "Install" to activate Locadex for your repository: ![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/6.png) -### Step 7: Review the PR +## Step 7: Review the PR Locadex will create a pull request on your main branch. This may take a few minutes to complete. @@ -67,17 +67,17 @@ Locadex will create a pull request on your main branch. This may take a few minu Review the PR and merge it to complete your i18n setup. -### Step 8: Continuous internationalization +## Step 8: Continuous internationalization After the initial setup PR is merged, Locadex monitors your main branch for commits and updates translations as needed. ![Installation screen for Locadex](https://assets.gtx.dev/locadex-screenshots/mintlify/8.png) -### Supported frameworks +## Supported frameworks Currently, Locadex only supports Mintlify and [Next.js App router](/docs/locadex) apps. -### Troubleshooting +## Troubleshooting When you have Locadex installed across multiple GitHub accounts or organizations, the dashboard will display a list of all of the accounts and organizations. Connecting to an account or organization will link that account to your current GT org. diff --git a/docs/en-US/locadex/next.mdx b/docs/en-US/locadex/next.mdx index 1f3e3ea05..af6af3650 100644 --- a/docs/en-US/locadex/next.mdx +++ b/docs/en-US/locadex/next.mdx @@ -17,6 +17,8 @@ Locadex: - Translates your app into as many languages as you need - Continuously internationalizes and translates as you push new content +## Installation + ### Step 1: Sign into the General Translation Dashboard Go to your [Dashboard](https://dash.generaltranslation.com) and sign in to your account. @@ -74,7 +76,7 @@ After the initial setup is merged: 1. Locadex monitors your main or specified branch for pull requests 2. When you push new code with translatable content, wait for Locadex to add its commit to the PR -3. Once Locadex commits to the PR, it is safe to merge -- your new code is internationalized +3. Once Locadex commits to the PR, it is safe to merge โ€” your new code is internationalized 4. Your app stays translated without manual intervention ## Monitoring your repository diff --git a/docs/en-US/next/api/components/tx.mdx b/docs/en-US/next/api/components/tx.mdx index 9e8c23adb..1169922de 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 waiting for an on-demand translation 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. -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/strings/tx.mdx b/docs/en-US/next/api/strings/tx.mdx index 2f00e28df..217e6cab6 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 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/dictionaries.mdx b/docs/en-US/next/guides/dictionaries.mdx index 3b81d06a0..95da7359a 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/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/get-translations.mdx b/docs/en-US/node/api/get-translations.mdx index 6844cded5..c4380cc30 100644 --- a/docs/en-US/node/api/get-translations.mdx +++ b/docs/en-US/node/api/get-translations.mdx @@ -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: diff --git a/docs/en-US/node/api/strings/msg.mdx b/docs/en-US/node/api/strings/msg.mdx index 88c5fb320..733be9471 100644 --- a/docs/en-US/node/api/strings/msg.mdx +++ b/docs/en-US/node/api/strings/msg.mdx @@ -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..e97dcad8c 100644 --- a/docs/en-US/node/guides/strings.mdx +++ b/docs/en-US/node/guides/strings.mdx @@ -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`: @@ -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/overview/faqs.mdx b/docs/en-US/overview/faqs.mdx index 560283943..cdbb90dea 100644 --- a/docs/en-US/overview/faqs.mdx +++ b/docs/en-US/overview/faqs.mdx @@ -3,7 +3,7 @@ title: FAQs description: Frequently Asked Questions --- -### What is a locale? +## What is a locale? A locale is **a language or dialect**. For example, `en-US` is a locale code, which refers to the English language as spoken in the United States of America. @@ -11,14 +11,14 @@ For example, `en-US` is a locale code, which refers to the English language as s * [Read more about locales](/docs/core/locales) * [List of supported locales](/docs/platform/supported-locales) -### Can I use the libraries without using the General Translation platform? +## Can I use the libraries without using the General Translation platform? 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). -### Section-specific FAQs +## Section-specific FAQs - [Platform](/docs/platform/faqs) - [Locadex AI Agent](/docs/locadex/faqs) diff --git a/docs/en-US/platform/supported-locales.mdx b/docs/en-US/platform/supported-locales.mdx index b4ab1255c..b47759b1a 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/python/guides/strings.mdx b/docs/en-US/python/guides/strings.mdx index d20e93d59..c51aadc36 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/faqs.mdx b/docs/en-US/react-native/faqs.mdx index 09b63ed7c..8d3655dd6 100644 --- a/docs/en-US/react-native/faqs.mdx +++ b/docs/en-US/react-native/faqs.mdx @@ -3,17 +3,17 @@ title: FAQs description: Frequently asked questions about gt-react-native --- -### 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-native 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,10 +26,10 @@ 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-native/api/config/load-translations) for details on loading translations from local files.