File tree 3 files changed +7
-5
lines changed
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { Language } from '@sanity/document-internationalization'
3
3
export const supportedLanguages = [
4
4
{ id : 'en' , title : 'English' } ,
5
5
// { id: 'fr', title: 'Français' },
6
- // { id: 'ja', title: '日本語' },
6
+ { id : 'ja' , title : '日本語' } ,
7
7
] as const as Language [ ]
8
8
9
9
export const languages = supportedLanguages . map ( ( lang ) => lang ?. id )
Original file line number Diff line number Diff line change
1
+ import { cookies } from 'next/headers'
2
+ import { DEFAULT_LANG } from '@/lib/i18n'
1
3
import { fetchSanityLive } from '@/sanity/lib/fetch'
2
4
import { groq } from 'next-sanity'
3
- import { cookies } from 'next/headers'
4
5
import { stegaClean } from 'next-sanity'
5
6
import sortFeaturedPosts from './sortFeaturedPosts'
6
7
import { Suspense } from 'react'
@@ -18,7 +19,7 @@ export default async function BlogFrontpage({
18
19
showFeaturedPostsFirst : boolean
19
20
itemsPerPage : number
20
21
} > ) {
21
- const lang = ( await cookies ( ) ) . get ( 'lang' ) ?. value
22
+ const lang = ( await cookies ( ) ) . get ( 'lang' ) ?. value ?? DEFAULT_LANG
22
23
23
24
const posts = await fetchSanityLive < Sanity . BlogPost [ ] > ( {
24
25
query : groq `
Original file line number Diff line number Diff line change
1
+ import { cookies } from 'next/headers'
2
+ import { DEFAULT_LANG } from '@/lib/i18n'
1
3
import { fetchSanityLive } from '@/sanity/lib/fetch'
2
4
import { groq } from 'next-sanity'
3
- import { cookies } from 'next/headers'
4
5
import Pretitle from '@/ui/Pretitle'
5
6
import { PortableText , stegaClean } from 'next-sanity'
6
7
import FilterList from '@/ui/modules/blog/BlogList/FilterList'
@@ -26,7 +27,7 @@ export default async function BlogList({
26
27
displayFilters : boolean
27
28
filteredCategory : Sanity . BlogCategory
28
29
} > ) {
29
- const lang = ( await cookies ( ) ) . get ( 'lang' ) ?. value
30
+ const lang = ( await cookies ( ) ) . get ( 'lang' ) ?. value ?? DEFAULT_LANG
30
31
31
32
const posts = await fetchSanityLive < Sanity . BlogPost [ ] > ( {
32
33
query : groq `
You can’t perform that action at this time.
0 commit comments