feat: first i18n

Signed-off-by: Filipe Medeiros <hello@filipesm.eu>
This commit is contained in:
Filipe Medeiros 2023-04-13 20:22:25 +01:00
parent c072a4b30e
commit 098e00e5e0
Signed by: filipe
GPG key ID: 9533BD5467CC1E78
9 changed files with 336 additions and 38 deletions

View file

@ -1,33 +0,0 @@
import getMostRecentRevisions from '../../lib/cms/getMostRecentRevisions';
import groq from 'groq';
export const forBlogPostPage = groq`
${getMostRecentRevisions(groq`_type == "blogPost"`)}
{
"slug": slug.current,
title,
content[]{
_type == 'image' => {
...,
"lqip": @.asset->metadata.lqip,
"alt": @.asset->altText,
"aspectRatio": @.asset->metadata.dimensions.aspectRatio
},
_type != 'image' => @
},
headerImage,
publishDate,
linkPreviewImage,
linkPreviewDescription,
twitterCardType
}`;
export const forBlogPage = groq`
${getMostRecentRevisions(groq`_type == "blogPost"`)}
{
title,
summary,
publishDate,
"slug": slug.current
}
`;

View file

@ -17,12 +17,16 @@ export const forBlogPostPage = groq`
},
headerImage,
publishDate,
summary,
metadata
linkPreviewImage,
linkPreviewDescription,
twitterCardType,
__i18n_lang
}`;
export const forBlogPage = groq`
${getMostRecentRevisions(groq`_type == "blogPost"`)}
${getMostRecentRevisions(
groq`_type == "blogPost" && __i18n_lang == $locale`,
)}
{
title,
summary,

View file

@ -2,7 +2,9 @@ import getMostRecentRevisions from '../getMostRecentRevisions';
import groq from 'groq';
export const forLibraryPage = groq`
${getMostRecentRevisions(groq`_type == "libraryItem"`)}
${getMostRecentRevisions(
groq`_type == "libraryItem" && __i18n_lang == $locale`,
)}
{
title,
description,

View file

@ -0,0 +1,10 @@
export default function langToLocale(lang: string) {
switch (lang) {
case 'pt':
return 'pt_PT';
case 'en':
return 'en_EN';
default:
return 'pt_PT';
}
}

View file

@ -16,6 +16,7 @@
],
"dependencies": {
"@portabletext/toolkit": "^2.0.1",
"@sanity/document-internationalization": "^1.1.1",
"@sanity/icons": "^2.2.2",
"@sanity/vision": "^3.8.3",
"react": "^18.2.0",

View file

@ -4,6 +4,9 @@ dependencies:
'@portabletext/toolkit':
specifier: ^2.0.1
version: 2.0.1
'@sanity/document-internationalization':
specifier: ^1.1.1
version: 1.1.1(lodash@4.17.21)(react-dom@18.2.0)(react-is@18.2.0)(react-router-dom@5.3.4)(react-router@5.3.4)(react@18.2.0)(rxjs@7.8.0)(sanity@3.8.3)(styled-components@5.3.9)
'@sanity/icons':
specifier: ^2.2.2
version: 2.2.2(react@18.2.0)
@ -1370,6 +1373,11 @@ packages:
w3c-keyname: 2.2.6
dev: false
/@cprecioso/country-flag-emoji@1.0.0:
resolution: {integrity: sha512-AFpV9SxC9O+3Dw8Bj/aDDCO6KtqGXQ0FEd02gbpV1Vb2IohG5CVvMQgpiZdjMURVozOIgiAbZ5BUI+0sGPDnvA==}
engines: {node: '>=14'}
dev: false
/@dnd-kit/accessibility@3.0.1(react@18.2.0):
resolution: {integrity: sha512-HXRrwS9YUYQO9lFRc/49uO/VICbM+O+ZRpFDe9Pd1rwVv2PCNkRiTZRdxrDgng/UkvdC3Re9r2vwPpXXrWeFzg==}
peerDependencies:
@ -2286,6 +2294,45 @@ packages:
diff-match-patch: 1.0.5
dev: false
/@sanity/document-internationalization@1.1.1(lodash@4.17.21)(react-dom@18.2.0)(react-is@18.2.0)(react-router-dom@5.3.4)(react-router@5.3.4)(react@18.2.0)(rxjs@7.8.0)(sanity@3.8.3)(styled-components@5.3.9):
resolution: {integrity: sha512-8NQG7fPKr9LkwE2T/3ROjo7q4ZSYDQ0TNeNxCL2ZhW4JmJVNBUlVHnbf3hTlx0ZOFWNiaKV72ulAm66xZnYnzg==}
engines: {node: '>=14'}
peerDependencies:
lodash: ^4.0.0
react: ^18
react-dom: ^18
react-router: ^5.0.0
react-router-dom: ^5.0.0
rxjs: ^7.0.0
sanity: ^3.0.0
styled-components: ^5.0.0
dependencies:
'@cprecioso/country-flag-emoji': 1.0.0
'@sanity/color': 2.2.5
'@sanity/icons': 2.2.2(react@18.2.0)
'@sanity/incompatible-plugin': 1.0.4(react-dom@18.2.0)(react@18.2.0)
'@sanity/ui': 1.3.1(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(styled-components@5.3.9)
'@sanity/uuid': 3.0.1
html-react-parser: 1.4.14(react@18.2.0)
just-omit: 2.2.0
just-safe-get: 4.2.0
just-split: 3.2.0
lodash: 4.17.21
pinst: 2.1.6
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
react-fast-compare: 3.2.1
react-router: 5.3.4(react@18.2.0)
react-router-dom: 5.3.4(react@18.2.0)
react-twemoji: 0.5.0(react@18.2.0)
rxjs: 7.8.0
sanity: 3.8.3(@types/react@18.0.34)(react-dom@18.2.0)(react@18.2.0)(styled-components@5.3.9)
styled-components: 5.3.9(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)
twemoji: 14.0.2
transitivePeerDependencies:
- react-is
dev: false
/@sanity/eslint-config-studio@2.0.1(eslint@8.38.0)(typescript@4.9.5):
resolution: {integrity: sha512-OcGYX7sZFxmR7Mhnd4w45IYei7atYqHRt1glU9DdnVXqTBjg30m6La1/EyPhjQGBdBqxkBB0TLwr0wuL7JhwuQ==}
requiresBuild: true
@ -3715,10 +3762,22 @@ packages:
csstype: 3.1.2
dev: false
/dom-serializer@1.4.1:
resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==}
dependencies:
domelementtype: 2.3.0
domhandler: 4.3.1
entities: 2.2.0
dev: false
/dom-walk@0.1.2:
resolution: {integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==}
dev: false
/domelementtype@2.3.0:
resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==}
dev: false
/domexception@4.0.0:
resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==}
engines: {node: '>=12'}
@ -3726,6 +3785,21 @@ packages:
webidl-conversions: 7.0.0
dev: false
/domhandler@4.3.1:
resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==}
engines: {node: '>= 4'}
dependencies:
domelementtype: 2.3.0
dev: false
/domutils@2.8.0:
resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==}
dependencies:
dom-serializer: 1.4.1
domelementtype: 2.3.0
domhandler: 4.3.1
dev: false
/dot-prop@5.3.0:
resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
engines: {node: '>=8'}
@ -3768,6 +3842,15 @@ packages:
once: 1.4.0
dev: false
/entities@2.2.0:
resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==}
dev: false
/entities@3.0.1:
resolution: {integrity: sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==}
engines: {node: '>=0.12'}
dev: false
/entities@4.4.0:
resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==}
engines: {node: '>=0.12'}
@ -4336,10 +4419,23 @@ packages:
readable-stream: 2.3.8
dev: false
/fromentries@1.3.2:
resolution: {integrity: sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==}
dev: false
/fs-constants@1.0.0:
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
dev: false
/fs-extra@8.1.0:
resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
engines: {node: '>=6 <7 || >=8'}
dependencies:
graceful-fs: 4.2.11
jsonfile: 4.0.0
universalify: 0.1.2
dev: false
/fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
@ -4624,6 +4720,17 @@ packages:
resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==}
dev: false
/history@4.10.1:
resolution: {integrity: sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==}
dependencies:
'@babel/runtime': 7.21.0
loose-envify: 1.4.0
resolve-pathname: 3.0.0
tiny-invariant: 1.0.6
tiny-warning: 1.0.3
value-equal: 1.0.1
dev: false
/history@5.3.0:
resolution: {integrity: sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==}
dependencies:
@ -4639,6 +4746,13 @@ packages:
resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
dev: false
/html-dom-parser@1.2.0:
resolution: {integrity: sha512-2HIpFMvvffsXHFUFjso0M9LqM+1Lm22BF+Df2ba+7QHJXjk63pWChEnI6YG27eaWqUdfnh5/Vy+OXrNTtepRsg==}
dependencies:
domhandler: 4.3.1
htmlparser2: 7.2.0
dev: false
/html-encoding-sniffer@3.0.0:
resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==}
engines: {node: '>=12'}
@ -4646,6 +4760,27 @@ packages:
whatwg-encoding: 2.0.0
dev: false
/html-react-parser@1.4.14(react@18.2.0):
resolution: {integrity: sha512-pxhNWGie8Y+DGDpSh8cTa0k3g8PsDcwlfolA+XxYo1AGDeB6e2rdlyv4ptU9bOTiZ2i3fID+6kyqs86MN0FYZQ==}
peerDependencies:
react: 0.14 || 15 || 16 || 17 || 18
dependencies:
domhandler: 4.3.1
html-dom-parser: 1.2.0
react: 18.2.0
react-property: 2.0.0
style-to-js: 1.1.1
dev: false
/htmlparser2@7.2.0:
resolution: {integrity: sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==}
dependencies:
domelementtype: 2.3.0
domhandler: 4.3.1
domutils: 2.8.0
entities: 3.0.1
dev: false
/http-proxy-agent@5.0.0:
resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==}
engines: {node: '>= 6'}
@ -4710,6 +4845,10 @@ packages:
/inherits@2.0.4:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
/inline-style-parser@0.1.1:
resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==}
dev: false
/internal-slot@1.0.5:
resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==}
engines: {node: '>= 0.4'}
@ -5080,6 +5219,20 @@ packages:
engines: {node: '>=6'}
hasBin: true
/jsonfile@4.0.0:
resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==}
optionalDependencies:
graceful-fs: 4.2.11
dev: false
/jsonfile@5.0.0:
resolution: {integrity: sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==}
dependencies:
universalify: 0.1.2
optionalDependencies:
graceful-fs: 4.2.11
dev: false
/jsx-ast-utils@3.3.3:
resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==}
engines: {node: '>=4.0'}
@ -5088,6 +5241,18 @@ packages:
object.assign: 4.1.4
dev: true
/just-omit@2.2.0:
resolution: {integrity: sha512-Js7+HxDOGcB3RhI38Mird/RgyMf3t0DAJFda1QWqqlAKTa36NeSYIufJXxrZUbysFTRcTOFcoMCiFK5FwCoI7Q==}
dev: false
/just-safe-get@4.2.0:
resolution: {integrity: sha512-+tS4Bvgr/FnmYxOGbwziJ8I2BFk+cP1gQHm6rm7zo61w1SbxBwWGEq/Ryy9Gb6bvnloPq6pz7Bmm4a0rjTNlXA==}
dev: false
/just-split@3.2.0:
resolution: {integrity: sha512-hh57dN5koTBkmg3T6gBFISVVaW5bgZ6Ct1W5KODD5M7hQJKqGzTKkfMwOil8MBxyztLQEjh/v6UGXE8cP5tnqQ==}
dev: false
/language-subtag-registry@0.3.22:
resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==}
dev: true
@ -5163,6 +5328,10 @@ packages:
resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==}
dev: false
/lodash.isequal@4.5.0:
resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
dev: false
/lodash.isplainobject@4.0.6:
resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==}
dev: false
@ -5624,6 +5793,12 @@ packages:
/path-parse@1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
/path-to-regexp@1.8.0:
resolution: {integrity: sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==}
dependencies:
isarray: 0.0.1
dev: false
/path-type@4.0.0:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
@ -5647,6 +5822,14 @@ packages:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
/pinst@2.1.6:
resolution: {integrity: sha512-B4dYmf6nEXg1NpDSB+orYWvKa5Kfmz5KzWC29U59dpVM4S/+xp0ak/JMEsw04UQTNNKps7klu0BUalr343Gt9g==}
engines: {node: '>=10.0.0'}
hasBin: true
dependencies:
fromentries: 1.3.2
dev: false
/pirates@4.0.5:
resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==}
engines: {node: '>= 6'}
@ -5920,6 +6103,10 @@ packages:
react: 18.2.0
dev: false
/react-property@2.0.0:
resolution: {integrity: sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw==}
dev: false
/react-redux@7.2.9(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==}
peerDependencies:
@ -5959,6 +6146,38 @@ packages:
engines: {node: '>=0.10.0'}
dev: false
/react-router-dom@5.3.4(react@18.2.0):
resolution: {integrity: sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==}
peerDependencies:
react: '>=15'
dependencies:
'@babel/runtime': 7.21.0
history: 4.10.1
loose-envify: 1.4.0
prop-types: 15.8.1
react: 18.2.0
react-router: 5.3.4(react@18.2.0)
tiny-invariant: 1.0.6
tiny-warning: 1.0.3
dev: false
/react-router@5.3.4(react@18.2.0):
resolution: {integrity: sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==}
peerDependencies:
react: '>=15'
dependencies:
'@babel/runtime': 7.21.0
history: 4.10.1
hoist-non-react-statics: 3.3.2
loose-envify: 1.4.0
path-to-regexp: 1.8.0
prop-types: 15.8.1
react: 18.2.0
react-is: 16.13.1
tiny-invariant: 1.0.6
tiny-warning: 1.0.3
dev: false
/react-rx@2.1.3(react@18.2.0)(rxjs@7.8.0):
resolution: {integrity: sha512-4dppkgEFAldr75IUUz14WyxuI2cJhpXYrrIM+4gvG6slKzaMUCmcgiiykx9Hst0UmtwNt247nRoOFDmN0Q7GJw==}
peerDependencies:
@ -6012,6 +6231,18 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
/react-twemoji@0.5.0(react@18.2.0):
resolution: {integrity: sha512-xz3NLWTFCfWOmPd559jcFX4f976ORIPpL9SwdBQO5BZwIYD1U1vpbY2E6k2vwPCVH78s2m1GbG5jpHKGUPZ+gw==}
engines: {node: '>=5.0'}
peerDependencies:
react: '>=16.4.2'
dependencies:
lodash.isequal: 4.5.0
prop-types: 15.8.1
react: 18.2.0
twemoji: 14.0.1
dev: false
/react-virtuoso@2.19.1(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-zF6MAwujNGy2nJWCx/Df92ay/RnV2Kj4glUZfdyadI4suAn0kAZHB1BeI7yPFVp2iSccLzFlszhakWyr+fJ4Dw==}
engines: {node: '>=10'}
@ -6196,6 +6427,10 @@ packages:
engines: {node: '>=8'}
dev: false
/resolve-pathname@3.0.0:
resolution: {integrity: sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==}
dev: false
/resolve@1.22.2:
resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==}
hasBin: true
@ -6729,6 +6964,18 @@ packages:
resolution: {integrity: sha512-C4myMmRTO8iaC5Gg+N1ftK2WT4eXUTMAa+HEFPPrfVeO/NtqLTtAmV1HbqnuGtLwCek44Ra76fdGUkSqjiMPcQ==}
dev: false
/style-to-js@1.1.1:
resolution: {integrity: sha512-RJ18Z9t2B02sYhZtfWKQq5uplVctgvjTfLWT7+Eb1zjUjIrWzX5SdlkwLGQozrqarTmEzJJ/YmdNJCUNI47elg==}
dependencies:
style-to-object: 0.3.0
dev: false
/style-to-object@0.3.0:
resolution: {integrity: sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==}
dependencies:
inline-style-parser: 0.1.1
dev: false
/style-value-types@5.0.0:
resolution: {integrity: sha512-08yq36Ikn4kx4YU6RD7jWEv27v4V+PUsOGa4n/as8Et3CuODMJQ00ENeAVXAeydX4Z2j1XHZF1K2sX4mGl18fA==}
dependencies:
@ -6897,6 +7144,28 @@ packages:
safe-buffer: 5.2.1
dev: false
/twemoji-parser@14.0.0:
resolution: {integrity: sha512-9DUOTGLOWs0pFWnh1p6NF+C3CkQ96PWmEFwhOVmT3WbecRC+68AIqpsnJXygfkFcp4aXbOp8Dwbhh/HQgvoRxA==}
dev: false
/twemoji@14.0.1:
resolution: {integrity: sha512-eoqhea0sUhmC10iTacksyp1v9O4BP1jKmVqtK+Nztw40/dzawSHkXL3/xCpyh+mukmEvJ0Gw9VLvwZfQ9HKXDw==}
dependencies:
fs-extra: 8.1.0
jsonfile: 5.0.0
twemoji-parser: 14.0.0
universalify: 0.1.2
dev: false
/twemoji@14.0.2:
resolution: {integrity: sha512-BzOoXIe1QVdmsUmZ54xbEH+8AgtOKUiG53zO5vVP2iUu6h5u9lN15NcuS6te4OY96qx0H7JK9vjjl9WQbkTRuA==}
dependencies:
fs-extra: 8.1.0
jsonfile: 5.0.0
twemoji-parser: 14.0.0
universalify: 0.1.2
dev: false
/type-check@0.3.2:
resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==}
engines: {node: '>= 0.8.0'}
@ -7006,6 +7275,11 @@ packages:
unist-util-is: 4.1.0
dev: false
/universalify@0.1.2:
resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==}
engines: {node: '>= 4.0.0'}
dev: false
/universalify@0.2.0:
resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}
engines: {node: '>= 4.0.0'}
@ -7118,6 +7392,10 @@ packages:
spdx-expression-parse: 3.0.1
dev: false
/value-equal@1.0.1:
resolution: {integrity: sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==}
dev: false
/vite@4.2.1:
resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==}
engines: {node: ^14.18.0 || >=16.0.0}

View file

@ -5,6 +5,7 @@ import {visionTool} from '@sanity/vision'
import {schemaTypes} from './schemas'
import {blogPostPublishAction} from './documentActions/blogPostPublishAction'
import {unsplashImageAsset} from 'sanity-plugin-asset-source-unsplash'
import {withDocumentI18nPlugin} from '@sanity/document-internationalization'
export default defineConfig({
name: 'personal-webiste',
@ -13,7 +14,12 @@ export default defineConfig({
projectId: 'tzamgyrm',
dataset: 'production',
plugins: [deskTool(), visionTool(), media(), unsplashImageAsset()],
plugins: withDocumentI18nPlugin([visionTool(), media(), unsplashImageAsset()], {
languages: [
{id: 'pt_PT', title: 'Português'},
{id: 'en_EN', title: 'English'},
],
}),
schema: {
types: schemaTypes,

View file

@ -6,6 +6,21 @@ const blogPost = defineType({
title: 'Blog posts',
type: 'document',
icon: DocumentTextIcon,
initialValue: {
__i18n_lang: 'pt_PT',
},
i18n: {
base: 'pt_PT',
languages: [
{id: 'pt_PT', title: 'Português'},
{id: 'en_EN', title: 'English'},
],
fieldNames: {
lang: '__i18n_lang',
references: '__i18n_refs',
baseReference: '__i18n_base',
},
},
fieldsets: [
{
name: 'metadata',

View file

@ -6,6 +6,21 @@ const libraryItem = defineType({
title: 'Library items',
type: 'document',
icon: BookIcon,
initialValue: {
__i18n_lang: 'pt_PT',
},
i18n: {
base: 'pt_PT',
languages: [
{id: 'pt_PT', title: 'Português'},
{id: 'en_EN', title: 'English'},
],
fieldNames: {
lang: '__i18n_lang',
references: '__i18n_refs',
baseReference: '__i18n_base',
},
},
fields: [
{
name: 'title',