0
0
NextJSframework~20 mins

Why i18n matters in NextJS - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
i18n Mastery in Next.js
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why is internationalization (i18n) important in web apps?

Imagine you build a website that only shows text in English. What problem might users from other countries face?

AThey will see the website in their own language automatically.
BThey might not understand the content because it’s only in English.
CThe website will load faster for them.
DThe website will have fewer images.
Attempts:
2 left
💡 Hint

Think about users who speak different languages than English.

component_behavior
intermediate
1:30remaining
What happens if you don’t provide translations in Next.js i18n config?

In Next.js, if you set up i18n but forget to add translations for a language, what will the user see?

AThe user will see fallback content, usually in the default language.
BThe app will crash with an error.
CThe user will see blank text where translations are missing.
DThe app will automatically translate text using AI.
Attempts:
2 left
💡 Hint

Think about how apps handle missing translations gracefully.

📝 Syntax
advanced
2:00remaining
Which Next.js i18n config correctly sets English and Spanish as supported languages?

Choose the correct i18n configuration snippet for Next.js that supports English (default) and Spanish.

A{ locales: ['en', 'es'], defaultLocale: 'en' }
B{ languages: ['en', 'es'], default: 'en' }
C{ locales: ['en', 'es'], default: 'es' }
D{ locales: ['en', 'es'], defaultLocale: 'fr' }
Attempts:
2 left
💡 Hint

Check the exact property names Next.js expects for i18n.

state_output
advanced
1:30remaining
What is the rendered output when switching locale in Next.js?

Given a Next.js app with English and Spanish translations for a greeting, what will the user see after switching locale from English to Spanish?

const translations = { en: 'Hello', es: 'Hola' };
AHelloHola
BHello
CHola
DError: Translation not found
Attempts:
2 left
💡 Hint

Think about what happens when you change the language setting.

🔧 Debug
expert
2:30remaining
Why does this Next.js i18n setup cause a 404 error on Spanish pages?

Look at this Next.js config snippet:

module.exports = { i18n: { locales: ['en', 'es'], defaultLocale: 'en' } }

Spanish pages return 404 errors. What is the likely cause?

ANext.js does not support multiple locales.
BThe defaultLocale should be 'es' instead of 'en'.
CThe locales array must include 'fr' for fallback.
DThe Spanish translation files are missing or misnamed.
Attempts:
2 left
💡 Hint

Check if translation files exist for all locales.