@@ -5,7 +5,7 @@ The translation function for server components.
55## Import
66
77``` ts
8- import { t } from ' @sylphx/rosetta/server' ;
8+ import { t } from ' @sylphx/rosetta-next /server' ;
99```
1010
1111## Signature
@@ -59,7 +59,7 @@ interface TranslateOptions {
5959### Basic Translation
6060
6161``` ts
62- import { t } from ' @sylphx/rosetta/server' ;
62+ import { t } from ' @sylphx/rosetta-next /server' ;
6363
6464function ServerComponent() {
6565 return <h1 >{t(" Welcome to our app" )}< / h1 > ;
@@ -156,7 +156,7 @@ t("Hello World", { context: "greeting" })
156156Get current locale:
157157
158158``` ts
159- import { getLocale } from ' @sylphx/rosetta/server' ;
159+ import { getLocale } from ' @sylphx/rosetta-next /server' ;
160160
161161const locale = getLocale (); // "zh-TW"
162162```
@@ -166,7 +166,7 @@ const locale = getLocale(); // "zh-TW"
166166Get fallback chain:
167167
168168``` ts
169- import { getLocaleChain } from ' @sylphx/rosetta/server' ;
169+ import { getLocaleChain } from ' @sylphx/rosetta-next /server' ;
170170
171171const chain = getLocaleChain (); // ["zh-TW", "zh", "en"]
172172```
@@ -176,7 +176,7 @@ const chain = getLocaleChain(); // ["zh-TW", "zh", "en"]
176176Get default locale:
177177
178178``` ts
179- import { getDefaultLocale } from ' @sylphx/rosetta/server' ;
179+ import { getDefaultLocale } from ' @sylphx/rosetta-next /server' ;
180180
181181const defaultLocale = getDefaultLocale (); // "en"
182182```
@@ -186,7 +186,7 @@ const defaultLocale = getDefaultLocale(); // "en"
186186Check if inside context:
187187
188188``` ts
189- import { isInsideRosettaContext } from ' @sylphx/rosetta/server' ;
189+ import { isInsideRosettaContext } from ' @sylphx/rosetta-next /server' ;
190190
191191if (isInsideRosettaContext ()) {
192192 // Safe to use t()
@@ -198,7 +198,7 @@ if (isInsideRosettaContext()) {
198198Get full context object:
199199
200200``` ts
201- import { getRosettaContext } from ' @sylphx/rosetta/server' ;
201+ import { getRosettaContext } from ' @sylphx/rosetta-next /server' ;
202202
203203const ctx = getRosettaContext ();
204204// { locale, defaultLocale, localeChain, translations, storage }
@@ -252,7 +252,7 @@ t(`Welcome, ${user.name}!`) // Won't be extracted!
252252## TypeScript
253253
254254``` ts
255- import type { TranslateFunction , TranslateOptions } from ' @sylphx/rosetta/server' ;
255+ import type { TranslateFunction , TranslateOptions } from ' @sylphx/rosetta-next /server' ;
256256
257257// Type-safe usage
258258const text: string = t (" Hello" );
0 commit comments