Skip to content
Chapter 84Lesson 7

Quiz - Internationalization

Quiz progress

0 / 0

Forty buttons across your app read “Save” in English. A teammate proposes routing all of them through a single t('common.save') key to avoid duplication. What is the senior call?

Mint a separate key per surface. The settings page’s “Save” (save preferences) and the checkout’s “Save” (place the order) may need different words in German — a shared key takes that choice away from the translator.

Use the shared common.save key. The English text is identical, so deduplicating is good engineering and keeps the catalog small.

Use common.save but override it per page in component code with a conditional, so each surface can diverge when needed.

You are authoring the catalog string for “You have N unread messages.” Which branch table is correct across every language, not just English?

{count, plural, =0 {No unread messages} one {# unread message} other {# unread messages}}
{count, plural, =0 {No unread messages} =1 {{count} unread message} other {{count} unread messages}}

A 1,000-row invoice table renders each amount with value.toLocaleString(locale, { style: 'currency', currency }). The output is correct for every user. What is the problem, and what fixes it?

It is a scale bug: toLocaleString builds a throwaway formatter on every call, loading a CLDR slice each time. Construct one Intl.NumberFormat (behind a module-scope cache) and reuse it across all rows.

It is silently wrong output: toLocaleString ignores the currency option, so reach for Intl.NumberFormat to get the symbol right.

Nothing is wrong — toLocaleString is the recommended shortcut and the runtime caches the formatter internally between calls.

A signed-in user whose users.locale is 'fr-FR' opens a shared link to /de-DE/billing from a browser sending Accept-Language: en-US. Which locale renders?

de-DE — the URL prefix is the most explicit signal and sits at the top of the chain, above even a saved profile preference.

fr-FR — a signed-in user’s saved profile is the most deliberate, durable preference and should win over a URL someone else shared.

en-US — the browser’s Accept-Language reflects what this device is actually configured for right now.

Which statements about wiring next-intl into the Next.js 16 App Router are correct? Select all that apply.

Every page.tsx and layout.tsx under app/[locale]/ must start with setRequestLocale(locale); skip it in any one and that route silently converts to dynamic rendering with no error or warning.

In next-intl v4, mounting <NextIntlClientProvider> with no messages prop forwards the entire catalog into the client bundle — scope it to the smallest subtree and pick only the namespaces those client components use.

Server Components must use getTranslations because useTranslations is a hook that only runs in Client Components.

You ship /billing (English, default) and /fr-FR/billing (French). On the French page, what should alternates.canonical point to?

/fr-FR/billing — each locale variant is its own canonical, so the French page claims itself as authoritative.

/billing — English is the source of truth and the translations are derivatives, so all variants should canonicalize to the original.

Quiz complete

Score by topic