diff --git a/docs/en-US/node/guides/strings.mdx b/docs/en-US/node/guides/strings.mdx index 877797a..bcf13fd 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'; @@ -96,7 +96,7 @@ app.post('/api/translate', async (req, res) => { | `tx()` | Dynamic or user-generated content not known at build time | - Both approaches produce identical translations. The difference is only in code organization — pick whichever fits your project structure. + `getGT()` and `msg()` / `getMessages()` both produce identical build-time translations. The difference is only in code organization — pick whichever fits your project structure. Use `tx()` only when the content is not known at build time. ## Using `$context` for disambiguation