Welcome to my app
+This content will be translated automatically.
+From 3002228995e2343e08c2993e390d69f4070a0eae Mon Sep 17 00:00:00 2001
From: Kevin Liu This content is translated automatically. This content will be translated automatically.
- Displaying {n} item{n === 1 ? '' : 's'}
- {t('summary.item_count', { count: itemCount })} {t('summary.discount_applied', { percent: discount })} {t('summary.total_label')} You have {itemCount} items in your cart. {discount}% discount applied! Total (before tax): Explore projects from teams around the world. {pluralize(items, `${items} item`, `${items} items`)} {pluralize(viewers, '1 person is watching', `${viewers} people are watching`)} {t('messages', { count })} {t('summary.item_count', { count: itemCount })} Explore projects from teams around the world.Welcome to our app
- Welcome to my app
+
"2 people are watching" | Irregular noun ("person" → "people") and verb changes needed. |
-| Item deletion | "Delete this message?"
"Delete these 2 messages?" | Demonstrative changes ("this" vs. "these") plus noun pluralization. |
-| Search results | "No results"
"1 result found"
"2 results found" | Different phrasing for zero, one, and multiple results. |
+```tsx
+import { T, Plural, Num } from 'gt-react';
-Using conditional expressions quickly becomes unwieldy.
-
-And it becomes a nightmare when you need to ship your app in other languages.
-What works for English often breaks completely in languages like Polish or Arabic, which have entirely different rules for handling quantities.
-**Companies we work with often put off internationalization
-because of the pain of refactoring hardcoded UI like this.**
-
----
-
-## How to handle plurals in English
-
-In English, using the right plurals in your app is usually straightforward.
-
-For simple noun pluralization, write a utility function:
-
-```jsx
-export function pluralize(
- count: number,
- singular: string,
- plural: string = singular + 's'
-) {
- return `${count === 1 ? singular : plural}`;
-}
+{t('summary.title')}
- Order Summary
- Find your next project
+ About Us
;
-}
-```
-
-For the default locale without a prefix, adjust accordingly:
-
-```tsx
-import { getDefaultLocale } from 'gt-next';
-import { getLocale } from 'gt-next/server';
-
-export async function generateMetadata() {
- const locale = await getLocale();
- const defaultLocale = getDefaultLocale();
- const path = '/about';
-
- const prefix = locale === defaultLocale ? '' : `/${locale}`;
-
- return {
- alternates: {
- canonical: `${BASE_URL}${prefix}${path}`,
- },
- };
-}
-```
-
----
-
-## 4. Hreflang tags
-
-Hreflang tags are the most important multilingual SEO signal.
-They tell search engines: "this page exists in these other languages, and here are the URLs."
-
-Without hreflang, Google has to guess which language version to show in search results — and it often gets it wrong.
-
-```html
-
-
-
-
-```
-
-The `x-default` tag tells search engines which URL to show when none of the specified languages match the user.
-
-In Next.js, you can add hreflang through the metadata API's `alternates.languages` property.
-Here's a reusable helper that works with gt-next:
-
-```tsx title="lib/i18n-metadata.ts"
-import { getDefaultLocale } from 'gt-next';
-import { getLocale } from 'gt-next/server';
-
-const BASE_URL = 'https://example.com';
-const SUPPORTED_LOCALES = ['en', 'fr', 'es'];
-
-export async function getI18NMetadata(path: string) {
- const locale = await getLocale();
- const defaultLocale = getDefaultLocale();
-
- const getUrl = (loc: string) => {
- const prefix = loc === defaultLocale ? '' : `/${loc}`;
- return `${BASE_URL}${prefix}${path}`;
- };
-
- const languages: Record{t('summary.title')}
+ Find your next project
- Order summary
+
You have
Explore projects from teams around the world.
++ Hi {name}, read the terms of service before you continue. +
+`) keep their own names in the string. The `components` prop replaces numbers with names: with `components={{ termsLink: }}`, the string reads `
+ the store to buy some groceries.
+ Explore projects from teams around the world.
+
+ Your total is This content will be translated automatically. Your order is on its way. This content will be translated automatically.Find your next project
+ Projects for {ownerName}
+ Welcome to my app
+ Welcome back
+ Welcome to my app
+