# การทำ Internationalization ใน Nuxt (Vue.js / Nuxt.js) > โมดูล i18n, การแปล, การตรวจจับ locale, การโลคัลไลซ์ route, การสลับภาษา, SEO หลายภาษา - 18 คำถามสัมภาษณ์ - Senior - [คำถามสัมภาษณ์: Vue.js / Nuxt.js](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions.md) ## 1. โมดูล @nuxtjs/i18n มอบอะไรให้กับแอปพลิเคชัน Nuxt? **คำตอบ** โมดูล @nuxtjs/i18n ผสาน vue-i18n เข้ากับ Nuxt และเพิ่มฟีเจอร์เฉพาะของ framework เช่น routing อัตโนมัติต่อ locale, การตรวจจับภาษาของเบราว์เซอร์, SEO หลายภาษา และการสร้าง route ที่โลคัลไลซ์โดยอัตโนมัติ มันช่วยลดความซับซ้อนในการตั้งค่าแอปพลิเคชันหลายภาษาอย่างมาก โดยจัดการแง่มุมทางเทคนิคที่ซับซ้อนโดยอัตโนมัติ เช่น การ redirect, แท็ก meta alternate และ lazy loading ของการแปล ## 2. การกำหนดค่าใดที่ช่วยให้กำหนด locale เริ่มต้นของแอปพลิเคชัน Nuxt i18n ได้? **คำตอบ** พรอเพอร์ตี้ defaultLocale ในการกำหนดค่า i18n จะกำหนดภาษาเริ่มต้นที่ใช้เมื่อไม่มีการตรวจพบหรือร้องขอ locale ที่เฉพาะเจาะจง locale นี้ทำหน้าที่เป็น fallback และใช้สำหรับ root ของไซต์หาก strategy ของ routing อนุญาต มันต้องตรงกับโค้ดหนึ่งที่กำหนดไว้ในอาร์เรย์ locales นี่เป็นพารามิเตอร์พื้นฐานที่รับประกันว่าแอปพลิเคชันจะมีภาษาอ้างอิงที่ใช้งานได้เสมอ ## 3. จะเข้าถึงการแปลในคอมโพเนนต์ Vue ด้วย @nuxtjs/i18n ได้อย่างไร? **คำตอบ** Composable useI18n ที่ @nuxtjs/i18n จัดเตรียมไว้จะ expose ฟังก์ชัน t ซึ่งช่วยให้เข้าถึงการแปลที่กำหนดไว้ในไฟล์ locale ได้ ฟังก์ชันนี้รับคีย์การแปลและพารามิเตอร์ที่เป็นทางเลือกสำหรับการ interpolation นี่เป็นวิธีที่แนะนำใน Nuxt 3 ด้วย Composition API แทนที่ไวยากรณ์เก่า this.$t composable ยังให้การเข้าถึงฟีเจอร์อื่น ๆ เช่น locale, locales และ setLocale เพื่อจัดการภาษาแบบไดนามิก ## มีอีก 15 คำถาม - จะเปลี่ยน locale ที่ใช้งานอยู่แบบไดนามิกในแอปพลิเคชัน Nuxt i18n ได้อย่างไร? - ความแตกต่างระหว่างกลยุทธ์ routing แบบ prefix_except_default และ prefix คืออะไร? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ Vue.js / Nuxt.js อื่นๆ - [พื้นฐาน JavaScript](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/javascript-fundamentals.md): 20 คำถาม, Junior - [JavaScript สมัยใหม่ (ES6+)](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/es6-modern-javascript.md): 20 คำถาม, Junior - [พื้นฐาน Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-basics.md): 22 คำถาม, Junior - [คอมโพเนนต์ Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-components.md): 20 คำถาม, Junior - [Vue Router](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-router.md): 18 คำถาม, Junior - [Pinia State Management](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/pinia-state-management.md): 20 คำถาม, Junior - [Vuex (Legacy)](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vuex-legacy.md): 15 คำถาม, Mid-Level - [Composition API](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/composition-api.md): 24 คำถาม, Mid-Level - [ระบบ Reactivity ของ Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-reactivity.md): 20 คำถาม, Mid-Level - [พื้นฐาน Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-fundamentals.md): 22 คำถาม, Mid-Level - [การดึงข้อมูล (Data Fetching) ใน Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-data-fetching.md): 20 คำถาม, Mid-Level - [SSR และ SSG ใน Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-ssr-ssg.md): 22 คำถาม, Mid-Level - [Server Routes ของ Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-server-routes.md): 20 คำถาม, Mid-Level - [โมดูล Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-modules.md): 18 คำถาม, Mid-Level - [Composables ใน Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-composables.md): 20 คำถาม, Mid-Level - [ฟอร์มและการตรวจสอบ Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-forms-validation.md): 20 คำถาม, Mid-Level - [การจัดการสถานะใน Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-state-management.md): 18 คำถาม, Mid-Level - [การทดสอบ Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-testing.md): 20 คำถาม, Mid-Level - [การ Deploy Nuxt และ CI/CD](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-deployment-cicd.md): 22 คำถาม, Mid-Level - [ประสิทธิภาพของ Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-performance.md): 22 คำถาม, Senior - [รูปแบบขั้นสูงของ Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-advanced-patterns.md): 24 คำถาม, Senior - [TypeScript กับ Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/typescript-vue.md): 22 คำถาม, Senior - [การยืนยันตัวตน Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-auth.md): 20 คำถาม, Senior - [SEO ด้วย Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-seo.md): 20 คำถาม, Senior - [สถาปัตยกรรม Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-architecture.md): 22 คำถาม, Senior - [ความปลอดภัยของ Nuxt](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-security.md): 20 คำถาม, Senior - [ระบบนิเวศ Vue](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/vue-ecosystem.md): 18 คำถาม, Senior - [การย้าย Vue 2→3 & Nuxt 2→3](https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/migration-vue2-vue3-nuxt2-nuxt3.md): 22 คำถาม, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/th/technologies/vue-nuxt/interview-questions/nuxt-i18n