🌍 NextJS · flashcards
NextJS Internationalization (i18n) Flashcards
51 question-and-answer cards covering Internationalization (i18n) as it is examined in NextJS. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the Internationalization (i18n) deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
What is pluralization handling in i18n, and why is it needed?
It selects the correct message form based on a count, because languages have different plural rules (English has one/other; others like Arabic or Polish have several categories like zero/one/two/few/many/other).
Which JavaScript standard API do modern i18n libraries use for locale-aware plural category selection?
The Intl.PluralRules API, which returns the plural category (e.g., "one", "other") for a given number in a given locale.
Which built-in browser/Node API is used for locale-aware number and currency formatting?
Intl.NumberFormat, e.g. `new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(1234.5)`.
Which built-in API is used for locale-aware date and time formatting in i18n?
Intl.DateTimeFormat, e.g. `new Intl.DateTimeFormat('fr-FR', { dateStyle: 'long' }).format(new Date())`.
What is a "fallback language" (fallback locale) in i18n?
A default locale whose translations are used when a requested locale is unavailable or is missing a specific key, ensuring the user always sees some text instead of a broken/blank string.
What behavior should occur when a translation key is missing in the active locale but present in the fallback locale?
The i18n system should fall back to the fallback locale's value for that key (key-level fallback), so the UI shows the fallback text rather than the raw key or an empty string.
In next-i18next / i18next, which configuration option sets the fallback language?
The `fallbackLng` option, which can be a single locale string, an array of ordered fallbacks, or an object mapping locales to their fallbacks.
What is a "fallback chain" in locale resolution?
An ordered sequence of locales tried in turn when a key is missing, e.g. pt-BR → pt → en, so a regional locale falls back to its base language and then to a global default.
When a specific regional locale like en-GB lacks a string, what is the natural first fallback before the global default?
Its base language locale (en), since regional variants typically differ only in some strings while sharing most of the base language's translations.
What are localized meta tags, and which SEO-relevant tags do they usually include?
Meta tags whose content is translated per locale—commonly the page <title>, meta description, and Open Graph/Twitter tags—so search results and social previews appear in the user's language.
In the Next.js App Router, which function is used to produce localized meta tags per route?
The `generateMetadata` async function exported from a page or layout, which receives `params` (including the locale) and returns a localized Metadata object.
Within generateMetadata, how do you produce translated title and description values?
Read the locale from params, load that locale's dictionary/translations, and set the title and description fields of the returned Metadata object to the translated strings.
Which HTML attribute on the <html> element should reflect the current locale for accessibility and SEO?
The `lang` attribute, e.g. `<html lang="fr">`, which tells browsers, screen readers, and search engines the page's language.
In the App Router, where is the correct place to set the <html lang> attribute per locale?
In the localized root layout at app/[lang]/layout.tsx, setting `<html lang={params.lang}>` using the current locale param.
What is a sitemap, and what is a localized sitemap?
A sitemap is an XML file listing a site's URLs to help search engines crawl them. A localized sitemap additionally lists each URL's localized variants and their language relationships so search engines index all language versions.
In the Next.js App Router, which special file generates a sitemap, and what does its default export return?
app/sitemap.ts (or sitemap.js); it default-exports a function returning an array of sitemap entry objects, each with fields like url, lastModified, changeFrequency, and priority.
How do you represent alternate-language URLs inside a Next.js sitemap entry?
Add an `alternates` property with a `languages` object mapping each locale code to its URL, e.g. `alternates: { languages: { en: '.../en', fr: '.../fr' } }`, which emits xhtml:link hreflang entries.
What is the hreflang attribute used for in HTML/sitemaps?
It tells search engines which language and optionally region a given URL targets, so the correct localized version is shown to users based on their language/location, avoiding duplicate-content penalties across translations.
What are the two valid places to declare hreflang annotations for a page?
In the HTML <head> as `<link rel="alternate" hreflang="..." href="...">` tags, or as xhtml:link alternate entries within the XML sitemap. (HTTP Link headers are a third option.)
Write the format of an hreflang link tag pointing the French version to a URL.
`<link rel="alternate" hreflang="fr" href="https://example.com/fr/page" />`
What is the special hreflang value `x-default`, and when is it used?
`x-default` designates the fallback/default page for users whose language/region doesn't match any listed hreflang value—typically a language selector or the default-locale page.
What is the reciprocity (bidirectional) rule for hreflang annotations?
hreflang links must be mutual: if page A lists page B as an alternate, page B must also list page A. Missing return links cause search engines to ignore the annotations.
What format must the hreflang value use to specify both a language and a region, e.g., Brazilian Portuguese?
An ISO 639-1 language code optionally followed by a hyphen and an ISO 3166-1 Alpha-2 region code, e.g. `pt-BR` (language first, then region). Region alone is not allowed.
When generating hreflang tags in the App Router, which Metadata field produces `<link rel="alternate" hreflang>` tags?
The `alternates.languages` field of the Metadata object (returned from generateMetadata), which Next.js renders as the appropriate hreflang alternate link tags.
What this deck covers
The Internationalization (i18n) deck follows the NextJS Internationalization (i18n) syllabus — 3 chapters and 9 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 17.0 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 162 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
Internationalization (i18n) flashcards FAQ
How many Internationalization (i18n) flashcards are in this NextJS deck?
51 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these NextJS flashcards free?
Yes. The preview here is free to read with no signup, and the full 51-card deck is free inside the Examius app.
What do the Internationalization (i18n) cards cover?
They follow the NextJS Internationalization (i18n) syllabus — 3 chapters and 9 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.