Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/en-US/react/tutorials/mini-shop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ title: Internationalize a Mini Shop
description: A hands-on React tutorial that internationalizes a simple shop using GT React components, hooks, and shared strings
---

Get a small, fully local mini shop running and translated — no external services, no routing, no UI frameworks. Youll use the core GT React features end-to-end and see how they fit together in a simple, realistic UI.
Get a small, fully local "mini shop" running and translated — no external services, no routing, no UI frameworks. You'll use the core GT React features end-to-end and see how they fit together in a simple, realistic UI.

Prerequisites: React, basic JavaScript/TypeScript

What youll build
- A single-page shop with a product grid and a simple in-memory cart
What you'll build
- A single-page "shop" with a product grid and a simple in-memory cart
- Language switcher and shared navigation labels
- Properly internationalized numbers, currency, and pluralization
- Optional: local translation storage for production builds
Expand Down Expand Up @@ -55,7 +55,7 @@ Install packages and wrap your app with the provider.
<Callout>
Optional: Starter Project (Vite)

If youre starting from scratch, scaffold a Vite React + TypeScript app and then install GT packages:
If you're starting from scratch, scaffold a Vite React + TypeScript app and then install GT packages:

```bash copy
npm create vite@latest mini-shop -- --template react-ts
Expand Down Expand Up @@ -102,7 +102,7 @@ Learn more in [Production vs Development](/docs/react/concepts/environments).
<Tabs items={["Vite (dev)", "Get keys"]}>
<Tab value="Vite (dev)">
```bash title=".env.local" copy
VITE_GT_API_KEY="your-dev-api-key"
VITE_GT_DEV_API_KEY="your-dev-api-key"
VITE_GT_PROJECT_ID="your-project-id"
```
</Tab>
Expand All @@ -121,7 +121,7 @@ Learn more in [Production vs Development](/docs/react/concepts/environments).

## Seed data and app structure

Well hardcode a tiny product array and keep everything client-side. No servers, no routing.
We'll hardcode a tiny product array and keep everything client-side. No servers, no routing.

```ts title="src/data.ts" copy
export type Product = {
Expand Down Expand Up @@ -237,7 +237,7 @@ export default function ProductCard({ product, onAdd }: { product: Product; onAd

## Cart with pluralization and totals

Use [`<Plural>`](/docs/react/api/components/plural) to express X items in cart and [`<Currency>`](/docs/react/api/components/currency) for totals. Combine with [`<T>`](/docs/react/api/components/t), [`<Var>`](/docs/react/api/components/var), and [`<Num>`](/docs/react/api/components/num).
Use [`<Plural>`](/docs/react/api/components/plural) to express "X items in cart" and [`<Currency>`](/docs/react/api/components/currency) for totals. Combine with [`<T>`](/docs/react/api/components/t), [`<Var>`](/docs/react/api/components/var), and [`<Num>`](/docs/react/api/components/num).

```tsx title="src/components/Cart.tsx" copy
import { T, Plural, Var, Num, Currency } from 'gt-react';
Expand Down
Loading