-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
nuxt-i18n-micro
module integration (#357)
- Loading branch information
Showing
15 changed files
with
178 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
welcome: 'Welcome', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
welcome: 'ようこそ', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
welcome: 'ようこそ', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
welcome: 'Welcome', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
welcome: '欢迎光临', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import NuxtSitemap from '../../../src/module' | ||
|
||
export default defineNuxtConfig({ | ||
modules: [ | ||
NuxtSitemap, | ||
'nuxt-i18n-micro', | ||
], | ||
site: { | ||
url: 'https://nuxtseo.com', | ||
}, | ||
nitro: { | ||
prerender: { | ||
failOnError: false, | ||
ignore: ['/'], | ||
}, | ||
}, | ||
sitemap: { | ||
dynamicUrlsApiEndpoint: '/__sitemap', | ||
autoLastmod: false, | ||
credits: false, | ||
debug: true, | ||
}, | ||
i18n: { | ||
baseUrl: 'https://nuxtseo.com', | ||
detectBrowserLanguage: false, | ||
defaultLocale: 'en', | ||
strategy: 'prefix', | ||
locales: [ | ||
{ | ||
code: 'en', | ||
iso: 'en-US', | ||
}, | ||
{ | ||
code: 'es', | ||
iso: 'es-ES', | ||
}, | ||
{ | ||
code: 'fr', | ||
iso: 'fr-FR', | ||
}, | ||
], | ||
meta: true, | ||
}, | ||
|
||
compatibilityDate: '2024-07-22', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<div>{{ $route.params.page }}</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<script setup lang="ts"> | ||
import { prerenderRoutes } from '#imports' | ||
prerenderRoutes([ | ||
'/en/dynamic/foo', | ||
'/en/dynamic/bar', | ||
]) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<h1>{{ $t('welcome') }}</h1> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<div> | ||
<h1>{{ $t('welcome') }}</h1> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineSitemapEventHandler } from '#imports' | ||
|
||
export default defineSitemapEventHandler(() => { | ||
return [ | ||
{ | ||
loc: '/__sitemap/url', | ||
changefreq: 'weekly', | ||
_i18nTransform: true, | ||
}, | ||
] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { defineSitemapEventHandler } from '#imports' | ||
|
||
export default defineSitemapEventHandler(() => { | ||
return [ | ||
{ | ||
loc: '/en/dynamic/foo', | ||
}, | ||
{ | ||
loc: '/fr/dynamic/foo', | ||
}, | ||
{ | ||
loc: 'endless-dungeon', // issue with en being picked up as the locale | ||
_i18nTransform: true, | ||
}, | ||
{ | ||
loc: 'english-url', // issue with en being picked up as the locale | ||
}, | ||
// absolute URL issue | ||
{ loc: 'https://www.somedomain.com/abc/def' }, | ||
] | ||
}) |