From 0faf7d8900bde8f94c58b2da89fd8bb0f06c01a9 Mon Sep 17 00:00:00 2001 From: gabriel-logan Date: Sat, 1 Jun 2024 19:46:37 -0300 Subject: [PATCH] fix: bugs and create temporary sitemap --- docs/compareLangs.js | 58 ++- docs/src/app/NOTWORKING_sitemap_copy.ts | 257 +++++++++++ .../js/functions/cnpjIsValid/page.tsx | 3 + .../js/functions/cpfIsValid/page.tsx | 3 + .../js/functions/getOnlyEmail/page.tsx | 3 + .../js/functions/identifyFlagCard/page.tsx | 3 + .../js/functions/isAscii/page.tsx | 3 + .../js/functions/isBase64/page.tsx | 3 + .../documentation/js/functions/isCEP/page.tsx | 3 + .../js/functions/isCreditCardValid/page.tsx | 3 + .../js/functions/isDate/page.tsx | 3 + .../js/functions/isDecimal/page.tsx | 3 + .../js/functions/isEmail/page.tsx | 3 + .../js/functions/isEmpty/page.tsx | 3 + .../js/functions/isMACAddress/page.tsx | 3 + .../documentation/js/functions/isMD5/page.tsx | 3 + .../js/functions/isNumber/page.tsx | 3 + .../js/functions/isPort/page.tsx | 3 + .../js/functions/isPostalCode/page.tsx | 3 + .../js/functions/isTime/page.tsx | 3 + .../js/functions/isValidAudio/page.tsx | 3 + .../js/functions/isValidImage/page.tsx | 3 + .../js/functions/isValidPdf/page.tsx | 3 + .../js/functions/isValidTxt/page.tsx | 3 + .../js/functions/isValidVideo/page.tsx | 3 + .../functions/passwordStrengthTester/page.tsx | 3 + .../functions/validateBRPhoneNumber/page.tsx | 3 + .../js/functions/validateEmail/page.tsx | 3 + .../js/functions/validateName/page.tsx | 3 + .../functions/validatePassportNumber/page.tsx | 3 + .../js/functions/validatePassword/page.tsx | 3 + .../js/functions/validatePhoneNumber/page.tsx | 3 + .../js/functions/validateSurname/page.tsx | 3 + .../js/functions/validateTextarea/page.tsx | 3 + .../functions/validateUSPhoneNumber/page.tsx | 3 + .../js/functions/validateUsername/page.tsx | 3 + .../(doc-session)/documentation/js/page.tsx | 5 +- .../(doc-session)/documentation/page.tsx | 8 +- .../(doc-session)/documentation/py/page.tsx | 8 +- docs/src/app/[locale]/about/page.tsx | 6 +- docs/src/app/[locale]/info/page.tsx | 6 +- docs/src/app/[locale]/layout.tsx | 8 +- docs/src/app/[locale]/page.tsx | 6 +- .../app/[locale]/privacity-polices/page.tsx | 8 +- docs/src/app/[locale]/terms/page.tsx | 6 +- docs/src/app/manifest.ts | 2 +- docs/src/app/sitemap.ts | 194 ++++---- docs/src/components/Header/index.tsx | 11 +- .../components/SidebarWrapper/js/index.tsx | 421 +++--------------- docs/src/locales/client.ts | 2 +- docs/src/locales/server.ts | 2 +- docs/src/middleware.ts | 6 +- docs/src/types/Functions/Javascript/index.ts | 35 ++ docs/src/types/Functions/Python/index.ts | 1 + docs/src/types/Functions/index.ts | 1 + docs/src/types/Locales/index.ts | 14 +- 56 files changed, 696 insertions(+), 471 deletions(-) create mode 100644 docs/src/app/NOTWORKING_sitemap_copy.ts create mode 100644 docs/src/types/Functions/Javascript/index.ts create mode 100644 docs/src/types/Functions/Python/index.ts create mode 100644 docs/src/types/Functions/index.ts diff --git a/docs/compareLangs.js b/docs/compareLangs.js index 3141e5a..26db654 100644 --- a/docs/compareLangs.js +++ b/docs/compareLangs.js @@ -1,15 +1,28 @@ /* eslint-disable no-console */ -// MODE OF USE: node compareLangs.js - -const targetFileFromTerminal = process.argv.slice(2)[0]; // Nós usamos slice(2) para ignorar os +// MODE OF USE: node compareLangs.js ... const sourceFile = "en"; -const targetFile = targetFileFromTerminal || "pt"; -const srcFile = require(`./src/locales/${sourceFile}/${sourceFile}.json`); -const tgtFile = require(`./src/locales/${targetFile}/${targetFile}.json`); +const targetFilesFromTerminal = process.argv.slice(2); + +const defaultTargets = [ + "ar", + "de", + "es", + "fr", + "it", + "ja", + "nl", + "pt", + "ru", + "tr", + "zh-Hans", +]; + +const targetFiles = + targetFilesFromTerminal.length > 0 ? targetFilesFromTerminal : defaultTargets; -// rest of the code... +const srcFile = require(`./src/locales/${sourceFile}/${sourceFile}.json`); function findMissingTranslations(sourceMap, targetMap, prefix = "") { let missingKeys = []; @@ -32,13 +45,32 @@ function findMissingTranslations(sourceMap, targetMap, prefix = "") { return missingKeys; } -const missingTranslations = findMissingTranslations(srcFile, tgtFile); +targetFiles.forEach((targetFile) => { + let tgtFile = {}; + try { + tgtFile = require(`./src/locales/${targetFile}/${targetFile}.json`); + } catch { + console.log(`"${targetFile}" lang file not found`); + } + + const missingTranslations = findMissingTranslations(srcFile, tgtFile); -console.log( - missingTranslations.length - ? missingTranslations - : ` No missing translations between "${sourceFile}" lang and "${targetFile}" lang`, -); + console.log( + missingTranslations.length + ? missingTranslations + : ` No missing translations between "${sourceFile}" lang and "${targetFile}" lang`, + ); +}); + +if (targetFilesFromTerminal.length > 0) { + console.log( + "\n You can algo compare with the default languages: using only node compareLangs.js \n", + ); +} else { + console.log( + "\n You can also compare with unity languages: using node compareLangs.js ... \n", + ); +} // The script will output the missing translations in the console. // If there are no missing translations, the output will be an empty array. diff --git a/docs/src/app/NOTWORKING_sitemap_copy.ts b/docs/src/app/NOTWORKING_sitemap_copy.ts new file mode 100644 index 0000000..65dd6f0 --- /dev/null +++ b/docs/src/app/NOTWORKING_sitemap_copy.ts @@ -0,0 +1,257 @@ +import { MetadataRoute } from "next"; + +const hostUrl: string = + process.env.NEXT_PUBLIC_WEBSITE_URL ?? + "https://multiformvalidator.vercel.app"; + +function generateJsMaps(): MetadataRoute.Sitemap { + const prefix: string = "documentation/js/functions"; + + const functions: string[] = [ + "cnpjIsValid", + "cpfIsValid", + "getOnlyEmail", + "identifyFlagCard", + "isAscii", + "isBase64", + "isCEP", + "isCreditCardValid", + "isDate", + "isDecimal", + "isEmail", + "isEmpty", + "isMACAddress", + "isMD5", + "isNumber", + "isPort", + "isPostalCode", + "isTime", + "isValidAudio", + "isValidImage", + "isValidPdf", + "isValidTxt", + "isValidVideo", + "passwordStrengthTester", + "validateBRPhoneNumber", + "validateEmail", + "validateName", + "validatePassportNumber", + "validatePassword", + "validatePhoneNumber", + "validateSurname", + "validateTextarea", + "validateUsername", + "validateUSPhoneNumber", + ]; + + return functions.map((func) => ({ + url: `${hostUrl}/${prefix}/${func}`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.9, + alternates: { + languages: { + en: `${hostUrl}/en/${prefix}/${func}`, + pt: `${hostUrl}/pt/${prefix}/${func}`, + ar: `${hostUrl}/ar/${prefix}/${func}`, + de: `${hostUrl}/de/${prefix}/${func}`, + es: `${hostUrl}/es/${prefix}/${func}`, + fr: `${hostUrl}/fr/${prefix}/${func}`, + it: `${hostUrl}/it/${prefix}/${func}`, + ja: `${hostUrl}/ja/${prefix}/${func}`, + nl: `${hostUrl}/nl/${prefix}/${func}`, + ru: `${hostUrl}/ru/${prefix}/${func}`, + tr: `${hostUrl}/tr/${prefix}/${func}`, + zh: `${hostUrl}/zh/${prefix}/${func}`, + }, + }, + })); +} + +export default function sitemap(): MetadataRoute.Sitemap { + return [ + { + url: hostUrl, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.5, + alternates: { + languages: { + en: `${hostUrl}/en`, + pt: `${hostUrl}/pt`, + ar: `${hostUrl}/ar`, + de: `${hostUrl}/de`, + es: `${hostUrl}/es`, + fr: `${hostUrl}/fr`, + it: `${hostUrl}/it`, + ja: `${hostUrl}/ja`, + nl: `${hostUrl}/nl`, + ru: `${hostUrl}/ru`, + tr: `${hostUrl}/tr`, + zh: `${hostUrl}/zh`, + }, + }, + }, + { + url: `${hostUrl}/documentation`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.6, + alternates: { + languages: { + en: `${hostUrl}/en/documentation`, + pt: `${hostUrl}/pt/documentation`, + ar: `${hostUrl}/ar/documentation`, + de: `${hostUrl}/de/documentation`, + es: `${hostUrl}/es/documentation`, + fr: `${hostUrl}/fr/documentation`, + it: `${hostUrl}/it/documentation`, + ja: `${hostUrl}/ja/documentation`, + nl: `${hostUrl}/nl/documentation`, + ru: `${hostUrl}/ru/documentation`, + tr: `${hostUrl}/tr/documentation`, + zh: `${hostUrl}/zh/documentation`, + }, + }, + }, + { + url: `${hostUrl}/documentation/py`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.8, + alternates: { + languages: { + en: `${hostUrl}/en/documentation/py`, + pt: `${hostUrl}/pt/documentation/py`, + ar: `${hostUrl}/ar/documentation/py`, + de: `${hostUrl}/de/documentation/py`, + es: `${hostUrl}/es/documentation/py`, + fr: `${hostUrl}/fr/documentation/py`, + it: `${hostUrl}/it/documentation/py`, + ja: `${hostUrl}/ja/documentation/py`, + nl: `${hostUrl}/nl/documentation/py`, + ru: `${hostUrl}/ru/documentation/py`, + tr: `${hostUrl}/tr/documentation/py`, + zh: `${hostUrl}/zh/documentation/py`, + }, + }, + }, + { + url: `${hostUrl}/documentation/js`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 1, + alternates: { + languages: { + en: `${hostUrl}/en/documentation/js`, + pt: `${hostUrl}/pt/documentation/js`, + ar: `${hostUrl}/ar/documentation/js`, + de: `${hostUrl}/de/documentation/js`, + es: `${hostUrl}/es/documentation/js`, + fr: `${hostUrl}/fr/documentation/js`, + it: `${hostUrl}/it/documentation/js`, + ja: `${hostUrl}/ja/documentation/js`, + nl: `${hostUrl}/nl/documentation/js`, + ru: `${hostUrl}/ru/documentation/js`, + tr: `${hostUrl}/tr/documentation/js`, + zh: `${hostUrl}/zh/documentation/js`, + }, + }, + }, + { + url: `${hostUrl}/about`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.6, + alternates: { + languages: { + en: `${hostUrl}/en/about`, + pt: `${hostUrl}/pt/about`, + ar: `${hostUrl}/ar/about`, + de: `${hostUrl}/de/about`, + es: `${hostUrl}/es/about`, + fr: `${hostUrl}/fr/about`, + it: `${hostUrl}/it/about`, + ja: `${hostUrl}/ja/about`, + nl: `${hostUrl}/nl/about`, + ru: `${hostUrl}/ru/about`, + tr: `${hostUrl}/tr/about`, + zh: `${hostUrl}/zh/about`, + }, + }, + }, + { + url: `${hostUrl}/terms`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.3, + alternates: { + languages: { + en: `${hostUrl}/en/terms`, + pt: `${hostUrl}/pt/terms`, + ar: `${hostUrl}/ar/terms`, + de: `${hostUrl}/de/terms`, + es: `${hostUrl}/es/terms`, + fr: `${hostUrl}/fr/terms`, + it: `${hostUrl}/it/terms`, + ja: `${hostUrl}/ja/terms`, + nl: `${hostUrl}/nl/terms`, + ru: `${hostUrl}/ru/terms`, + tr: `${hostUrl}/tr/terms`, + zh: `${hostUrl}/zh/terms`, + }, + }, + }, + { + url: `${hostUrl}/privacity-polices`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.3, + alternates: { + languages: { + en: `${hostUrl}/en/privacity-polices`, + pt: `${hostUrl}/pt/privacity-polices`, + ar: `${hostUrl}/ar/privacity-polices`, + de: `${hostUrl}/de/privacity-polices`, + es: `${hostUrl}/es/privacity-polices`, + fr: `${hostUrl}/fr/privacity-polices`, + it: `${hostUrl}/it/privacity-polices`, + ja: `${hostUrl}/ja/privacity-polices`, + nl: `${hostUrl}/nl/privacity-polices`, + ru: `${hostUrl}/ru/privacity-polices`, + tr: `${hostUrl}/tr/privacity-polices`, + zh: `${hostUrl}/zh/privacity-polices`, + }, + }, + }, + { + url: `${hostUrl}/info`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.5, + alternates: { + languages: { + en: `${hostUrl}/en/info`, + pt: `${hostUrl}/pt/info`, + ar: `${hostUrl}/ar/info`, + de: `${hostUrl}/de/info`, + es: `${hostUrl}/es/info`, + fr: `${hostUrl}/fr/info`, + it: `${hostUrl}/it/info`, + ja: `${hostUrl}/ja/info`, + nl: `${hostUrl}/nl/info`, + ru: `${hostUrl}/ru/info`, + tr: `${hostUrl}/tr/info`, + zh: `${hostUrl}/zh/info`, + }, + }, + }, + { + url: `${hostUrl}/news`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.2, + }, + ...generateJsMaps(), + ]; +} diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/cnpjIsValid/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/cnpjIsValid/page.tsx index c5a396b..c3960cf 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/cnpjIsValid/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/cnpjIsValid/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function CnpjIsValid({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/cpfIsValid/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/cpfIsValid/page.tsx index a2dcdb6..ed6f92c 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/cpfIsValid/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/cpfIsValid/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function CpfIsValid({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/getOnlyEmail/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/getOnlyEmail/page.tsx index c2d9283..7563316 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/getOnlyEmail/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/getOnlyEmail/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function GetOnlyEmail({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/identifyFlagCard/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/identifyFlagCard/page.tsx index f1399ae..d67660a 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/identifyFlagCard/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/identifyFlagCard/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function IdentifyFlagCard({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isAscii/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isAscii/page.tsx index 2288af6..879b1a4 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isAscii/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isAscii/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsAscii({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isBase64/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isBase64/page.tsx index 045b539..20121eb 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isBase64/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isBase64/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsBase64({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isCEP/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isCEP/page.tsx index 5aab2bb..9499c4b 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isCEP/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isCEP/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsCEP({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isCreditCardValid/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isCreditCardValid/page.tsx index 57f0008..4ab6ba9 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isCreditCardValid/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isCreditCardValid/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function IsCreditCard({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isDate/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isDate/page.tsx index 28387b5..df3f9f8 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isDate/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isDate/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsDate({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isDecimal/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isDecimal/page.tsx index bebacfc..7e37071 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isDecimal/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isDecimal/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsDecimal({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isEmail/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isEmail/page.tsx index 683c443..4ac2b3f 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isEmail/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isEmail/page.tsx @@ -1,6 +1,7 @@ import "@/css/functions.css"; import Link from "next/link"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -9,6 +10,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsEmail({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isEmpty/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isEmpty/page.tsx index 34a36d5..3a7897d 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isEmpty/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isEmpty/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsEmpty({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isMACAddress/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isMACAddress/page.tsx index 1839971..10665d6 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isMACAddress/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isMACAddress/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function IsMACAddress({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isMD5/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isMD5/page.tsx index 55d53f9..d3cf965 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isMD5/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isMD5/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsMD5({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isNumber/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isNumber/page.tsx index a7309de..d87b2c1 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isNumber/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isNumber/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsNumber({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isPort/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isPort/page.tsx index 1960d35..9e6db70 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isPort/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isPort/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsPort({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isPostalCode/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isPostalCode/page.tsx index 1e7ea8c..e14c22c 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isPostalCode/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isPostalCode/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function IsPostalCode({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isTime/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isTime/page.tsx index baf365c..74befcc 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isTime/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isTime/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsTime({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidAudio/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidAudio/page.tsx index cf0951e..525ee35 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidAudio/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidAudio/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function IsValidAudio({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidImage/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidImage/page.tsx index 581a601..55d7a11 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidImage/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidImage/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function IsValidImage({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidPdf/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidPdf/page.tsx index 6294f99..db56ea8 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidPdf/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidPdf/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsValidPdf({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidTxt/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidTxt/page.tsx index 63f0474..12b45d0 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidTxt/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidTxt/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -8,6 +9,8 @@ import { getScopedI18n } from "@/locales/server"; import { LocaleParams } from "@/types/Params"; export default async function IsValidTxt({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidVideo/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidVideo/page.tsx index ca32eba..3a44210 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidVideo/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/isValidVideo/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function IsValidVideo({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/passwordStrengthTester/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/passwordStrengthTester/page.tsx index 7de5480..31d9318 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/passwordStrengthTester/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/passwordStrengthTester/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function PasswordStrengthTester({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateBRPhoneNumber/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateBRPhoneNumber/page.tsx index 8d43b9b..0b37954 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateBRPhoneNumber/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateBRPhoneNumber/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidateBRPhoneNumber({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateEmail/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateEmail/page.tsx index a584341..ca16952 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateEmail/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateEmail/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidateEmail({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateName/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateName/page.tsx index 96a0a3a..fe4e04b 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateName/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateName/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidateName({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePassportNumber/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePassportNumber/page.tsx index a214665..189e212 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePassportNumber/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePassportNumber/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidatePassportNumber({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePassword/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePassword/page.tsx index 65ce823..7148d06 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePassword/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePassword/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidatePassword({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePhoneNumber/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePhoneNumber/page.tsx index e8ad337..867aa45 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePhoneNumber/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validatePhoneNumber/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidatePhoneNumber({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateSurname/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateSurname/page.tsx index bfe42d2..bb5e1fe 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateSurname/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateSurname/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidateSurname({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateTextarea/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateTextarea/page.tsx index 7fc7c55..f5745e2 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateTextarea/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateTextarea/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidateTextarea({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateUSPhoneNumber/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateUSPhoneNumber/page.tsx index 2ee4ce0..a9d06da 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateUSPhoneNumber/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateUSPhoneNumber/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function validateUSPhoneNumber({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateUsername/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateUsername/page.tsx index 0094736..ba9c1f2 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateUsername/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/functions/validateUsername/page.tsx @@ -1,5 +1,6 @@ import "@/css/functions.css"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; @@ -10,6 +11,8 @@ import { LocaleParams } from "@/types/Params"; export default async function ValidateUsername({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("DocumentationJsFunctions"); return (
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/js/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/js/page.tsx index ea7281c..a24e1ab 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/js/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/js/page.tsx @@ -1,5 +1,6 @@ import Image from "next/image"; import Link from "next/link"; +import { setStaticParamsLocale } from "next-international/server"; import DrawerComponent from "@/components/Drawer"; import { getScopedI18n } from "@/locales/server"; @@ -15,9 +16,11 @@ import { export default async function DocumentationPageJs({ params: { locale }, }: LocaleParams) { + setStaticParamsLocale(locale); + const scopedT = await getScopedI18n("DocumentationJs"); return ( -
+
{/** */}
diff --git a/docs/src/app/[locale]/(doc-session)/documentation/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/page.tsx index c2c9ffe..87da5d3 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/page.tsx @@ -1,13 +1,19 @@ import Image from "next/image"; import Link from "next/link"; +import { setStaticParamsLocale } from "next-international/server"; import { RiJavascriptFill } from "react-icons/ri"; import javaIcon from "@/assets/icons/java-icon.svg"; import pythonIcon from "@/assets/icons/python-icon.svg"; import MainBg from "@/components/MainBg"; import { getScopedI18n } from "@/locales/server"; +import { LocaleParams } from "@/types/Params"; + +export default async function DocumentationPage({ + params: { locale }, +}: LocaleParams) { + setStaticParamsLocale(locale); -export default async function DocumentationPage() { const t = await getScopedI18n("DocumentationPage"); const basePath = "/documentation"; diff --git a/docs/src/app/[locale]/(doc-session)/documentation/py/page.tsx b/docs/src/app/[locale]/(doc-session)/documentation/py/page.tsx index 3e657ba..5f5307d 100644 --- a/docs/src/app/[locale]/(doc-session)/documentation/py/page.tsx +++ b/docs/src/app/[locale]/(doc-session)/documentation/py/page.tsx @@ -1,11 +1,17 @@ import Image from "next/image"; import Link from "next/link"; +import { setStaticParamsLocale } from "next-international/server"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism"; import { getScopedI18n } from "@/locales/server"; +import { LocaleParams } from "@/types/Params"; + +export default async function DocumentationPagePy({ + params: { locale }, +}: LocaleParams) { + setStaticParamsLocale(locale); -export default async function DocumentationPagePy() { const t = await getScopedI18n("DocumentationPython"); return ( diff --git a/docs/src/app/[locale]/about/page.tsx b/docs/src/app/[locale]/about/page.tsx index 5d10aa1..a497a3b 100644 --- a/docs/src/app/[locale]/about/page.tsx +++ b/docs/src/app/[locale]/about/page.tsx @@ -1,8 +1,10 @@ import "@/css/infos.css"; import { Metadata } from "next"; +import { setStaticParamsLocale } from "next-international/server"; import MainBg from "@/components/MainBg"; import { getScopedI18n } from "@/locales/server"; +import { LocaleParams } from "@/types/Params"; export async function generateMetadata(): Promise { const t = await getScopedI18n("About"); @@ -13,7 +15,9 @@ export async function generateMetadata(): Promise { }; } -export default async function AboutPage() { +export default async function AboutPage({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("About"); return ( diff --git a/docs/src/app/[locale]/info/page.tsx b/docs/src/app/[locale]/info/page.tsx index ac48987..3cbd648 100644 --- a/docs/src/app/[locale]/info/page.tsx +++ b/docs/src/app/[locale]/info/page.tsx @@ -1,8 +1,10 @@ import "@/css/infos.css"; import { Metadata } from "next"; +import { setStaticParamsLocale } from "next-international/server"; import MainBg from "@/components/MainBg"; import { getScopedI18n } from "@/locales/server"; +import { LocaleParams } from "@/types/Params"; export async function generateMetadata(): Promise { const t = await getScopedI18n("Info"); @@ -13,7 +15,9 @@ export async function generateMetadata(): Promise { }; } -export default async function InfoPage() { +export default async function InfoPage({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("Info"); return ( diff --git a/docs/src/app/[locale]/layout.tsx b/docs/src/app/[locale]/layout.tsx index 0b4c666..e5963de 100644 --- a/docs/src/app/[locale]/layout.tsx +++ b/docs/src/app/[locale]/layout.tsx @@ -3,16 +3,18 @@ import "../globals.css"; import { Analytics } from "@vercel/analytics/react"; import { SpeedInsights } from "@vercel/speed-insights/next"; import type { Metadata } from "next"; -import { Inter } from "next/font/google"; import Adsense from "@/components/Adsense"; import Footer from "@/components/Footer"; import Header from "@/components/Header"; +import { inter } from "@/fonts"; import { I18nProviderClient } from "@/locales/client"; -import { getScopedI18n } from "@/locales/server"; +import { getScopedI18n, getStaticParams } from "@/locales/server"; import { Locale } from "@/types/Locales"; -const inter = Inter({ subsets: ["latin"] }); +export function generateStaticParams() { + return getStaticParams(); +} export async function generateMetadata(): Promise { const scopedT = await getScopedI18n("HomeLayout"); diff --git a/docs/src/app/[locale]/page.tsx b/docs/src/app/[locale]/page.tsx index a06f643..f3262ad 100644 --- a/docs/src/app/[locale]/page.tsx +++ b/docs/src/app/[locale]/page.tsx @@ -1,11 +1,15 @@ import Image from "next/image"; import Link from "next/link"; +import { setStaticParamsLocale } from "next-international/server"; import MainBg from "@/components/MainBg"; import { merriweather, oswald, playfair, roboto100, sofiaPro } from "@/fonts"; import { getScopedI18n } from "@/locales/server"; +import { LocaleParams } from "@/types/Params"; + +export default async function Page({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); -export default async function Page() { const t = await getScopedI18n("HomePage"); return ( diff --git a/docs/src/app/[locale]/privacity-polices/page.tsx b/docs/src/app/[locale]/privacity-polices/page.tsx index f0a3edc..8fb308f 100644 --- a/docs/src/app/[locale]/privacity-polices/page.tsx +++ b/docs/src/app/[locale]/privacity-polices/page.tsx @@ -1,9 +1,11 @@ import "@/css/infos.css"; import { Metadata } from "next"; +import { setStaticParamsLocale } from "next-international/server"; import MainBg from "@/components/MainBg"; import { getScopedI18n } from "@/locales/server"; +import { LocaleParams } from "@/types/Params"; export async function generateMetadata(): Promise { const t = await getScopedI18n("PrivacyPolices"); @@ -13,7 +15,11 @@ export async function generateMetadata(): Promise { }; } -export default async function PrivacityPolicesPage() { +export default async function PrivacityPolicesPage({ + params: { locale }, +}: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("PrivacyPolices"); return ( diff --git a/docs/src/app/[locale]/terms/page.tsx b/docs/src/app/[locale]/terms/page.tsx index 18adbfa..e50619e 100644 --- a/docs/src/app/[locale]/terms/page.tsx +++ b/docs/src/app/[locale]/terms/page.tsx @@ -1,9 +1,11 @@ import "@/css/infos.css"; import { Metadata } from "next"; +import { setStaticParamsLocale } from "next-international/server"; import MainBg from "@/components/MainBg"; import { getScopedI18n } from "@/locales/server"; +import { LocaleParams } from "@/types/Params"; export async function generateMetadata(): Promise { const t = await getScopedI18n("Terms"); @@ -14,7 +16,9 @@ export async function generateMetadata(): Promise { }; } -export default async function TermsPage() { +export default async function TermsPage({ params: { locale } }: LocaleParams) { + setStaticParamsLocale(locale); + const t = await getScopedI18n("Terms"); return ( diff --git a/docs/src/app/manifest.ts b/docs/src/app/manifest.ts index 1e3915c..4ef33be 100644 --- a/docs/src/app/manifest.ts +++ b/docs/src/app/manifest.ts @@ -2,7 +2,7 @@ import { MetadataRoute } from "next"; import en from "@/locales/en/en.json"; -export default async function manifest(): Promise { +export default function manifest(): MetadataRoute.Manifest { const scoped = en.Manifest; return { diff --git a/docs/src/app/sitemap.ts b/docs/src/app/sitemap.ts index 760c608..61b5923 100644 --- a/docs/src/app/sitemap.ts +++ b/docs/src/app/sitemap.ts @@ -1,13 +1,41 @@ import { MetadataRoute } from "next"; +import { JsFuncTypes } from "@/types/Functions/Javascript"; +import { Langs } from "@/types/Locales"; + const hostUrl: string = process.env.NEXT_PUBLIC_WEBSITE_URL ?? - "https://gabriel-logan.github.io/multiform-validator"; + "https://multiformvalidator.vercel.app"; + +const languages: Langs[] = [ + "en", + "pt", + "ar", + "de", + "es", + "fr", + "it", + "ja", + "nl", + "ru", + "tr", + "zh", +]; + +const ChangeFrequency = { + ALWAYS: "always", + HOURLY: "hourly", + DAILY: "daily", + WEEKLY: "weekly", + MONTHLY: "monthly", + YEARLY: "yearly", + NEVER: "never", +} as const; function generateJsMaps(): MetadataRoute.Sitemap { const prefix: string = "documentation/js/functions"; - const functions: string[] = [ + const functions: JsFuncTypes[] = [ "cnpjIsValid", "cpfIsValid", "getOnlyEmail", @@ -44,117 +72,76 @@ function generateJsMaps(): MetadataRoute.Sitemap { "validateUSPhoneNumber", ]; - return functions.map((func) => ({ + const homeMetadata = functions.map((func) => ({ url: `${hostUrl}/${prefix}/${func}`, lastModified: new Date(), - changeFrequency: "monthly", + changeFrequency: ChangeFrequency.MONTHLY, priority: 0.9, - alternates: { - languages: { - en: `${hostUrl}/en/${prefix}/${func}`, - pt: `${hostUrl}/pt/${prefix}/${func}`, - }, - }, })); + + const alternatesMetadata = functions.flatMap((func) => + languages.map((lang) => ({ + url: `${hostUrl}/${lang}/${prefix}/${func}`, + lastModified: new Date(), + changeFrequency: ChangeFrequency.MONTHLY, + priority: 0.9, + })), + ); + + const metadata = [...homeMetadata, ...alternatesMetadata]; + + return metadata; } -export default function sitemap(): MetadataRoute.Sitemap { - return [ +function generateBasicMetadata(): MetadataRoute.Sitemap { + const homeMetadata: MetadataRoute.Sitemap = [ { url: hostUrl, lastModified: new Date(), changeFrequency: "monthly", priority: 0.5, - alternates: { - languages: { - en: `${hostUrl}/en`, - pt: `${hostUrl}/pt`, - }, - }, }, { url: `${hostUrl}/documentation`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.6, - alternates: { - languages: { - en: `${hostUrl}/en/documentation`, - pt: `${hostUrl}/pt/documentation`, - }, - }, }, { url: `${hostUrl}/documentation/py`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.8, - alternates: { - languages: { - en: `${hostUrl}/en/documentation/py`, - pt: `${hostUrl}/pt/documentation/py`, - }, - }, }, { url: `${hostUrl}/documentation/js`, lastModified: new Date(), changeFrequency: "monthly", priority: 1, - alternates: { - languages: { - en: `${hostUrl}/en/documentation/js`, - pt: `${hostUrl}/pt/documentation/js`, - }, - }, }, { url: `${hostUrl}/about`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.6, - alternates: { - languages: { - en: `${hostUrl}/en/about`, - pt: `${hostUrl}/pt/about`, - }, - }, }, { url: `${hostUrl}/terms`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.3, - alternates: { - languages: { - en: `${hostUrl}/en/terms`, - pt: `${hostUrl}/pt/terms`, - }, - }, }, { url: `${hostUrl}/privacity-polices`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.3, - alternates: { - languages: { - en: `${hostUrl}/en/privacity-polices`, - pt: `${hostUrl}/pt/privacity-polices`, - }, - }, }, { url: `${hostUrl}/info`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.5, - alternates: { - languages: { - en: `${hostUrl}/en/info`, - pt: `${hostUrl}/pt/info`, - }, - }, }, { url: `${hostUrl}/news`, @@ -162,31 +149,70 @@ export default function sitemap(): MetadataRoute.Sitemap { changeFrequency: "monthly", priority: 0.2, }, - ...generateJsMaps(), ]; -} -/** - * example: - * { - url: hostUrl, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 1, - alternates: { - languages: { - pt: `${hostUrl}/pt`, - }, + const alternatesMetadata: MetadataRoute.Sitemap = languages.flatMap( + (lang) => [ + { + url: `${hostUrl}/${lang}`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.5, }, - }, - */ + { + url: `${hostUrl}/${lang}/documentation`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.6, + }, + { + url: `${hostUrl}/${lang}/documentation/py`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.8, + }, + { + url: `${hostUrl}/${lang}/documentation/js`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 1, + }, + { + url: `${hostUrl}/${lang}/about`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.6, + }, + { + url: `${hostUrl}/${lang}/terms`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.3, + }, + { + url: `${hostUrl}/${lang}/privacity-polices`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.3, + }, + { + url: `${hostUrl}/${lang}/info`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.5, + }, + { + url: `${hostUrl}/${lang}/news`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.2, + }, + ], + ); -/** -info -documentation -about -terms -privacity-polices -documentation/py -documentation/js -*/ + return [...homeMetadata, ...alternatesMetadata]; +} + +export default function sitemap(): MetadataRoute.Sitemap { + return [...generateBasicMetadata(), ...generateJsMaps()]; +} diff --git a/docs/src/components/Header/index.tsx b/docs/src/components/Header/index.tsx index a9a763a..1bca122 100644 --- a/docs/src/components/Header/index.tsx +++ b/docs/src/components/Header/index.tsx @@ -19,6 +19,7 @@ export default function Header({ locale }: Locale) { const path = usePathname(); const route = `/${locale}`; + const homeRoute = locale === "en" ? "/" : `/${locale}`; const show = path.startsWith(`/documentation/py`) || @@ -32,7 +33,7 @@ export default function Header({ locale }: Locale) { <>
-

+

{scopedT("header_title")}

@@ -60,9 +61,9 @@ export default function Header({ locale }: Locale) { setIsSubMenuOpen(false)} className="nav-link text-blue-500" - href={path === `${route}` ? "#" : `${route}`} + href={path === homeRoute ? "#" : homeRoute} > - {path === `${route}` + {path === homeRoute ? scopedT("header_already_here") : scopedT("header_go_home")} @@ -117,9 +118,9 @@ export default function Header({ locale }: Locale) { setIsSubMenuOpen(false)} className="text-blue-500" - href={path === `${route}/` ? "#" : `${route}/`} + href={path === homeRoute ? "#" : homeRoute} > - {path === `${route}/` + {path === homeRoute ? scopedT("header_already_here") : scopedT("header_go_home")} diff --git a/docs/src/components/SidebarWrapper/js/index.tsx b/docs/src/components/SidebarWrapper/js/index.tsx index b4fb8b1..27caa90 100644 --- a/docs/src/components/SidebarWrapper/js/index.tsx +++ b/docs/src/components/SidebarWrapper/js/index.tsx @@ -4,6 +4,7 @@ import Link from "next/link"; import { usePathname } from "next/navigation"; import { useScopedI18n } from "@/locales/client"; +import { JsFuncTypes } from "@/types/Functions/Javascript"; import { Locale } from "@/types/Locales"; export default function SidebarWrapper({ locale }: Locale) { @@ -11,363 +12,79 @@ export default function SidebarWrapper({ locale }: Locale) { const path = usePathname(); + const compareToPath = locale === "en" ? "" : `/${locale}`; + const basePath = `/documentation/js/functions`; + + const functions: JsFuncTypes[] = [ + "cnpjIsValid", + "cpfIsValid", + "getOnlyEmail", + "identifyFlagCard", + "isAscii", + "isBase64", + "isCEP", + "isCreditCardValid", + "isDate", + "isDecimal", + "isEmail", + "isEmpty", + "isMACAddress", + "isMD5", + "isNumber", + "isPort", + "isPostalCode", + "isTime", + "isValidAudio", + "isValidImage", + "isValidPdf", + "isValidTxt", + "isValidVideo", + "passwordStrengthTester", + "validateBRPhoneNumber", + "validateEmail", + "validateName", + "validatePassportNumber", + "validatePassword", + "validatePhoneNumber", + "validateSurname", + "validateTextarea", + "validateUsername", + "validateUSPhoneNumber", + ]; + return (
    -
  • - - {scopedT("Documentation")} - -
  • -
  • - - {scopedT("Home")} - -
  • -
  • - - cnpjIsValid - -
  • -
  • - - cpfIsValid - -
  • -
  • - - getOnlyEmail - -
  • -
  • - - identifyFlagCard - -
  • -
  • - - isAscii - -
  • -
  • - - isBase64 - -
  • -
  • - - isCEP - -
  • -
  • - - isCreditCardValid - -
  • -
  • - - isDate - -
  • -
  • - - isDecimal - -
  • -
  • - - isEmail - -
  • -
  • - - isEmpty - -
  • -
  • - - isMACAddress - -
  • -
  • - - isMD5 - -
  • -
  • - - isNumber - -
  • -
  • - - isPort - -
  • -
  • - +
  • - isPostalCode - -
  • -
  • - - isTime - -
  • -
  • - - isValidAudio - -
  • -
  • - - isValidImage - -
  • -
  • - - isValidPdf - -
  • -
  • - - isValidTxt - -
  • -
  • - - isValidVideo - -
  • -
  • - - passwordStrengthTester - -
  • -
  • - - validateBRPhoneNumber - -
  • -
  • - - validateEmail - -
  • -
  • - - validateName - -
  • -
  • - - validatePassportNumber - -
  • -
  • - - validatePassword - -
  • -
  • - - validatePhoneNumber - -
  • -
  • - - validateSurname - -
  • -
  • - - validateTextarea - -
  • -
  • - - validateUsername - -
  • -
  • - + + + +
  • - validateUSPhoneNumber - -
  • + {scopedT("Home")} + + + + {functions.map((func: string, index: number) => { + const isLastItem = index === functions.length - 1; + const marginBottomClass = isLastItem ? "mb-4" : "mb-1"; + + return ( + +
  • + {func} +
  • + + ); + })}
); } diff --git a/docs/src/locales/client.ts b/docs/src/locales/client.ts index 814660d..3a3fca2 100644 --- a/docs/src/locales/client.ts +++ b/docs/src/locales/client.ts @@ -15,5 +15,5 @@ export const { useI18n, useScopedI18n, I18nProviderClient } = createI18nClient({ nl: () => import("./nl/nl.json"), ru: () => import("./ru/ru.json"), tr: () => import("./tr/tr.json"), - "zh-Hans": () => import("./zh-Hans/zh-Hans.json"), + zh: () => import("./zh-Hans/zh-Hans.json"), }); diff --git a/docs/src/locales/server.ts b/docs/src/locales/server.ts index 7edfc2f..be263f9 100644 --- a/docs/src/locales/server.ts +++ b/docs/src/locales/server.ts @@ -14,5 +14,5 @@ export const { getI18n, getScopedI18n, getStaticParams } = createI18nServer({ nl: () => import("./nl/nl.json"), ru: () => import("./ru/ru.json"), tr: () => import("./tr/tr.json"), - "zh-Hans": () => import("./zh-Hans/zh-Hans.json"), + zh: () => import("./zh-Hans/zh-Hans.json"), }); diff --git a/docs/src/middleware.ts b/docs/src/middleware.ts index 872b3b8..d1ae8e1 100644 --- a/docs/src/middleware.ts +++ b/docs/src/middleware.ts @@ -1,7 +1,9 @@ import { NextRequest } from "next/server"; import { createI18nMiddleware } from "next-international/middleware"; -const languages = [ +import { Langs } from "./types/Locales"; + +const languages: Langs[] = [ "en", "pt", "ar", @@ -13,7 +15,7 @@ const languages = [ "nl", "ru", "tr", - "zh-Hans", + "zh", ]; const I18nMiddleware = createI18nMiddleware({ diff --git a/docs/src/types/Functions/Javascript/index.ts b/docs/src/types/Functions/Javascript/index.ts new file mode 100644 index 0000000..794ad24 --- /dev/null +++ b/docs/src/types/Functions/Javascript/index.ts @@ -0,0 +1,35 @@ +export type JsFuncTypes = + | "cnpjIsValid" + | "cpfIsValid" + | "getOnlyEmail" + | "identifyFlagCard" + | "isAscii" + | "isBase64" + | "isCEP" + | "isCreditCardValid" + | "isDate" + | "isDecimal" + | "isEmail" + | "isEmpty" + | "isMACAddress" + | "isMD5" + | "isNumber" + | "isPort" + | "isPostalCode" + | "isTime" + | "isValidAudio" + | "isValidImage" + | "isValidPdf" + | "isValidTxt" + | "isValidVideo" + | "passwordStrengthTester" + | "validateBRPhoneNumber" + | "validateEmail" + | "validateName" + | "validatePassportNumber" + | "validatePassword" + | "validatePhoneNumber" + | "validateSurname" + | "validateTextarea" + | "validateUsername" + | "validateUSPhoneNumber"; diff --git a/docs/src/types/Functions/Python/index.ts b/docs/src/types/Functions/Python/index.ts new file mode 100644 index 0000000..8337712 --- /dev/null +++ b/docs/src/types/Functions/Python/index.ts @@ -0,0 +1 @@ +// diff --git a/docs/src/types/Functions/index.ts b/docs/src/types/Functions/index.ts new file mode 100644 index 0000000..8337712 --- /dev/null +++ b/docs/src/types/Functions/index.ts @@ -0,0 +1 @@ +// diff --git a/docs/src/types/Locales/index.ts b/docs/src/types/Locales/index.ts index 207e0a8..6230480 100644 --- a/docs/src/types/Locales/index.ts +++ b/docs/src/types/Locales/index.ts @@ -1,4 +1,16 @@ -type Langs = "en" | "pt"; +export type Langs = + | "en" + | "pt" + | "ar" + | "de" + | "es" + | "fr" + | "it" + | "ja" + | "nl" + | "ru" + | "tr" + | "zh"; export interface Locale { locale: Langs;