Upgrade gatsby-plugin-react-i18next to new release

This commit is contained in:
Kevin Kandlbinder 2021-02-12 08:58:37 +01:00
parent ad2bcd3312
commit 37b12abb78
14 changed files with 421 additions and 49 deletions

View file

@ -29,6 +29,13 @@ module.exports = {
path: `./content/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/locales`,
name: `locale`
},
},
`gatsby-plugin-sass`,
{
resolve: `gatsby-plugin-manifest`,
@ -58,9 +65,10 @@ module.exports = {
{
resolve: `gatsby-plugin-react-i18next`,
options: {
path: `${__dirname}/locales`,
localeJsonSourceName: `locale`,
languages: extConfig.languages,
defaultLanguage: null,
defaultLanguage: `en`,
generateDefaultLanguagePage: true,
siteUrl: extConfig.siteURL,
i18nextOptions: {
interpolation: {

251
package-lock.json generated
View file

@ -12227,6 +12227,242 @@
}
}
},
"gatsby-cli": {
"version": "2.19.1",
"resolved": "https://registry.npmjs.org/gatsby-cli/-/gatsby-cli-2.19.1.tgz",
"integrity": "sha512-lJ+0HgcTGVmEzkaPVTeqVQUxpt3oW3ad0p1hcYzViVtjkGOBxIQdD11yJiC9ZvmKi9FWW7e/tFTdrMEylFLmIA==",
"requires": {
"@babel/code-frame": "^7.10.4",
"@hapi/joi": "^15.1.1",
"@types/common-tags": "^1.8.0",
"better-opn": "^2.0.0",
"chalk": "^4.1.0",
"clipboardy": "^2.3.0",
"common-tags": "^1.8.0",
"configstore": "^5.0.1",
"convert-hrtime": "^3.0.0",
"create-gatsby": "^0.5.1",
"envinfo": "^7.7.3",
"execa": "^3.4.0",
"fs-exists-cached": "^1.0.0",
"fs-extra": "^8.1.0",
"gatsby-core-utils": "^1.10.0",
"gatsby-recipes": "^0.9.1",
"gatsby-telemetry": "^1.10.0",
"hosted-git-info": "^3.0.6",
"is-valid-path": "^0.1.1",
"lodash": "^4.17.20",
"meant": "^1.0.2",
"node-fetch": "^2.6.1",
"opentracing": "^0.14.4",
"pretty-error": "^2.1.1",
"progress": "^2.0.3",
"prompts": "^2.3.2",
"redux": "^4.0.5",
"resolve-cwd": "^3.0.0",
"semver": "^7.3.2",
"signal-exit": "^3.0.3",
"source-map": "0.7.3",
"stack-trace": "^0.0.10",
"strip-ansi": "^5.2.0",
"update-notifier": "^5.0.1",
"uuid": "3.4.0",
"yargs": "^15.4.1",
"yoga-layout-prebuilt": "^1.9.6",
"yurnalist": "^2.1.0"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
},
"dependencies": {
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"requires": {
"ansi-regex": "^5.0.0"
}
}
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"execa": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-3.4.0.tgz",
"integrity": "sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g==",
"requires": {
"cross-spawn": "^7.0.0",
"get-stream": "^5.0.0",
"human-signals": "^1.1.1",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.0",
"onetime": "^5.1.0",
"p-finally": "^2.0.0",
"signal-exit": "^3.0.2",
"strip-final-newline": "^2.0.0"
}
},
"hosted-git-info": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz",
"integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"p-finally": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz",
"integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw=="
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
},
"string-width": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
"integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
},
"dependencies": {
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"requires": {
"ansi-regex": "^5.0.0"
}
}
}
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"requires": {
"isexe": "^2.0.0"
}
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"dependencies": {
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"requires": {
"ansi-regex": "^5.0.0"
}
}
}
},
"y18n": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
"integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ=="
},
"yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"requires": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
}
},
"yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"requires": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
}
}
}
},
"gatsby-core-utils": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/gatsby-core-utils/-/gatsby-core-utils-1.10.0.tgz",
@ -12539,14 +12775,14 @@
}
},
"gatsby-plugin-react-i18next": {
"version": "0.0.27",
"resolved": "https://registry.npmjs.org/gatsby-plugin-react-i18next/-/gatsby-plugin-react-i18next-0.0.27.tgz",
"integrity": "sha512-tjLO6bKZuXvZx0gdDxZ4fmc780G+2hnt6atj+9h8XLwtTrUkumjUORkFw8Wx5DCeNqtI5pRHFQ7KlQq5Pt0Bgw==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/gatsby-plugin-react-i18next/-/gatsby-plugin-react-i18next-1.0.3.tgz",
"integrity": "sha512-QmNPT8smIRYwc7M6uaIQl+gL6P2wCgSg9IWnzpdYoVU14DRt435J2ACTeTSP4+GeulFkTzJxBrr9obSPoCAROA==",
"requires": {
"bluebird": "^3.7.2",
"browser-lang": "^0.1.0",
"glob": "^7.1.6",
"path-to-regexp": "^6.1.0",
"outdent": "^0.8.0",
"path-to-regexp": "^6.2.0",
"react-helmet": "^6.1.0"
},
"dependencies": {
@ -17106,6 +17342,11 @@
"os-tmpdir": "^1.0.0"
}
},
"outdent": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/outdent/-/outdent-0.8.0.tgz",
"integrity": "sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A=="
},
"ow": {
"version": "0.17.0",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.17.0.tgz",

View file

@ -24,11 +24,12 @@
"animejs": "^3.2.1",
"babel-plugin-i18next-extract": "^0.8.2",
"gatsby": "^2.32.3",
"gatsby-cli": "^2.19.1",
"gatsby-plugin-asset-path": "^3.0.3",
"gatsby-plugin-manifest": "^2.12.0",
"gatsby-plugin-offline": "^3.10.0",
"gatsby-plugin-react-helmet": "^3.10.0",
"gatsby-plugin-react-i18next": "0.0.27",
"gatsby-plugin-react-i18next": "^1.0.3",
"gatsby-plugin-robots-txt": "^1.5.5",
"gatsby-plugin-sass": "^2.8.0",
"gatsby-plugin-sharp": "^2.14.1",

View file

@ -39,7 +39,7 @@ Layout.propTypes = {
title: PropTypes.string.isRequired,
module: PropTypes.string.isRequired,
transparentTopbar: PropTypes.bool,
children: PropTypes.object.isRequired
children: PropTypes.any.isRequired
}
export default Layout;

View file

@ -1,35 +1,45 @@
import React, { useState } from "react"
import Layout from "../layouts/default";
import { useStaticQuery, graphql } from "gatsby";
import { graphql } from "gatsby";
import { Trans, useI18next, I18nextContext } from "gatsby-plugin-react-i18next"
import PropTypes from "prop-types"
import styles from "./donate.module.scss";
export default function DonatePage() {
export const query = graphql`
query ($language: String!) {
site {
siteMetadata {
title
siteUrl
payPalMail
}
}
file(relativePath: {eq: "images/pplogo.png"}) {
childImageSharp {
resize(width: 240, height: 240, fit: CONTAIN) {
src
}
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`;
function DonatePage(props) {
const [amount, setAmount] = useState(5);
const { t } = useI18next();
const { path } = React.useContext(I18nextContext);
const { site, file } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
title
siteUrl
payPalMail
}
}
file(relativePath: {eq: "images/pplogo.png"}) {
childImageSharp {
resize(width: 240, height: 240, fit: CONTAIN) {
src
}
}
}
}
`
)
const { site, file } = props.data;
return (
<Layout module="donate" title={t("donate")} description={t("donationCatchphrase")}>
@ -50,4 +60,10 @@ export default function DonatePage() {
</section>
</Layout>
);
}
}
DonatePage.propTypes = {
data: PropTypes.object.isRequired
};
export default DonatePage;

View file

@ -1,20 +1,30 @@
import React from "react"
import Layout from "../../layouts/default";
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
import { useStaticQuery, graphql } from "gatsby";
import { graphql } from "gatsby";
import PropTypes from "prop-types"
export default function ImprintPage() {
const { site } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
contactEmail
}
}
}
`
)
export const query = graphql`
query GetThankYouPage($language: String!) {
site {
siteMetadata {
contactEmail
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`
function ThankYouPage(props) {
const { site } = props.data
let contactEmail = site.siteMetadata.contactEmail;
const { t } = useI18next();
@ -29,4 +39,10 @@ export default function ImprintPage() {
</section>
</Layout>
);
}
}
ThankYouPage.propTypes = {
data: PropTypes.object.isRequired
};
export default ThankYouPage;

View file

@ -7,7 +7,7 @@ import PropTypes from "prop-types"
import styles from "./friends.module.scss";
export const query = graphql`
query AllFriendsQuery {
query AllFriendsQuery($language: String!) {
allFriendsJson {
nodes {
name
@ -16,6 +16,15 @@ query AllFriendsQuery {
imageURL
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`

View file

@ -38,6 +38,15 @@ export const query = graphql`
featured
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`;

View file

@ -1,6 +1,21 @@
import React from "react"
import Layout from "../../layouts/default";
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
import { graphql } from "gatsby";
export const query = graphql`
query ($language: String!) {
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`
export default function ImprintPage() {

View file

@ -1,6 +1,21 @@
import React from "react"
import Layout from "../../layouts/default";
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
import { graphql } from "gatsby";
export const query = graphql`
query ($language: String!) {
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`
export default function DataSecPage() {

View file

@ -1,6 +1,21 @@
import React from "react"
import Layout from "../../layouts/default";
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
import { graphql } from "gatsby";
export const query = graphql`
query ($language: String!) {
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`
export default function DisclaimerPage() {

View file

@ -23,6 +23,15 @@ query GetProjects($language: String) {
shortDescription
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`

View file

@ -7,7 +7,7 @@ import PropTypes from "prop-types"
import styles from "./social.module.scss";
export const query = graphql`
query AllSocialsQuery {
query AllSocialsQuery($language: String!) {
allSocialsJson {
nodes {
image
@ -16,6 +16,15 @@ query AllSocialsQuery {
url
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`

View file

@ -7,7 +7,7 @@ import PropTypes from "prop-types"
import styles from "./project.module.scss";
export const query = graphql`
query GetProject($urlname: String!, $lang: String!) {
query GetProject($urlname: String!, $lang: String!, $language: String!) {
allProjectsJson(filter: {urlname: {eq: $urlname}, lang: {eq: $lang}}) {
nodes {
lang
@ -24,6 +24,15 @@ query GetProject($urlname: String!, $lang: String!) {
shortDescription
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`