Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update i18n config #134

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions locales/zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Space"
}
14 changes: 14 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,22 @@ export default defineNuxtConfig({
'nuxt-gtag',
'@nuxt/eslint',
'@vueuse/nuxt',
'@nuxtjs/i18n',
],

i18n: {
locales: [
{
code: 'zh-CN',
file: 'zh-CN.json',
name: '简体中文',
},
],
defaultLocale: 'zh-CN',
lazy: true,
langDir: 'locales/',
},
Comment on lines +69 to +80
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Missing locale file in the locales directory

The en-US.json file is missing in the locales directory. Please ensure that this file is added to the directory to complete the i18n configuration.

  • Missing file: locales/en-US.json
Analysis chain

The i18n configuration appears to be correctly set up with the necessary locales, defaultLocale, lazy loading, and language directory settings. Ensure that the locale files (en-US.json and zh-CN.json) exist in the specified locales directory.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the locale files exist in the specified locales directory.

# Test: Check for the existence of the locale files. Expect: Both files should exist.
fd --type f --name 'en-US.json' locales/
fd --type f --name 'zh-CN.json' locales/

Length of output: 583



Script:

#!/bin/bash
# Description: Verify that the locale files exist in the specified locales directory.

# Test: Check for the existence of the locale files. Expect: Both files should exist.
fd --type f 'en-US.json' locales/
fd --type f 'zh-CN.json' locales/

Length of output: 86


eslint: {
config: {
stylistic: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@nuxt/test-utils": "^3.12.0",
"@nuxtjs/google-fonts": "^3.2.0",
"@nuxtjs/html-validator": "^1.7.2",
"@nuxtjs/i18n": "^8.3.0",
"@nuxtjs/i18n": "^8.3.1",
"@nuxtjs/seo": "2.0.0-rc.10",
"@nuxtjs/tailwindcss": "^6.12.0",
"@nuxtjs/web-vitals": "^0.2.7",
Expand Down
Loading
Loading