diff --git a/astro-i18next.config.ts b/astro-i18next.config.ts index 2b3e6b322..a118d1132 100644 --- a/astro-i18next.config.ts +++ b/astro-i18next.config.ts @@ -2,6 +2,6 @@ export default { defaultLocale: "en", showDefaultLocale: true, - locales: ["en", "zh", "es"], + locales: ["en", "es"], load: ["server", "client"], } diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index ad8a263e6..7f6aeb42a 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -48,9 +48,12 @@ } }, "NewsletterCTA": { - "title": "Stay updated on the latest Scroll news", - "placeholder": "Enter your email address", - "buttonText": "Sign up" + "title": "Stay up-to-date on the latest Scroll Developer news", + "text": "Roadmap updates, virtual and live events, ecosystem opportunities and more", + "placeholder": "your email address here", + "thankYouForSubscribing": "Thank you for subscribing!", + "correctEmail": "Please use a correct email address.", + "pleaseInsertEmail": "Please insert your email." } }, "sidebar": { @@ -152,6 +155,30 @@ "additionalResources": "Additional Resources" } }, + "footer": { + "aboutScroll": { + "title": "About Scroll", + "bugBounty": "Bug Bounty", + "joinUs": "Join Us", + "healthStatus": "Health Status", + "privacyPolicy": "Privacy Policy", + "termsAndConditions": "Terms and Conditions" + }, + "resources": { + "title": "Resources", + "scrollDocsURL": "https://docs.scroll.io/", + "blog": "Blog", + "documentation": "Documentation", + "pressKit": "Press Kit" + }, + "followUs": { + "title": "Follow Us" + } + }, + "pageNotFound": { + "title": "Page not found", + "text": "We're sorry, but we couldn't find the page you were looking for." + }, "notTranslated": { "notTranslated": "This page has not been translated yet." } diff --git a/public/locales/es/translation.json b/public/locales/es/translation.json index e31da1785..33a54ed87 100644 --- a/public/locales/es/translation.json +++ b/public/locales/es/translation.json @@ -48,9 +48,12 @@ } }, "NewsletterCTA": { - "title": "Stay updated on the latest Scroll news", - "placeholder": "Enter your email address", - "buttonText": "Sign up" + "title": "Mantente actualizado con las más recientes noticias sobre el Desarrollo de Scroll", + "text": "Roadmap, actualizaciones, eventos virtuales y presenciales, oportunidades en el ecosistema y más", + "placeholder": "tu correo electrónico aquí", + "thankYouForSubscribing": "¡Gracias por suscribirte!", + "correctEmail": "Por favor usa un correo electrónico válido.", + "pleaseInsertEmail": "Por favor ingresa tu correo electrónico." } }, "sidebar": { @@ -152,7 +155,32 @@ "additionalResources": "Recursos Adicionales" } }, + "footer": { + "aboutScroll": { + "title": "Acerca de Scroll", + "bugBounty": "Cazarecompensas de bugs", + "joinUs": "Únete a nosotros", + "healthStatus": "Estado de servicios", + "privacyPolicy": "Políticas de privacidad", + "termsAndConditions": "Terminos y condiciones" + }, + "resources": { + "title": "Recursos", + "scrollDocsURL": "https://docs.scroll.io/es", + "blog": "Blog", + "documentation": "Documentación", + "pressKit": "Kit de Prensa" + }, + "followUs": { + "title": "Síguenos" + } + }, + "pageNotFound": { + "title": "Página no encontrada", + "text": "Lo sentimos, pero no pudimos encontrar la página que buscas." + }, "notTranslated": { "notTranslated": "Esta página no ha sido traducida aún." - } + }, + "This email cannot be added to this list. Please enter a different email address.": "Este correo electrónico no puede ser añadido a la lista. Por favor ingresa uno diferente." } diff --git a/src/components/Footer/Footer.astro b/src/components/Footer/Footer.astro new file mode 100644 index 000000000..5feac5c91 --- /dev/null +++ b/src/components/Footer/Footer.astro @@ -0,0 +1,10 @@ +--- +import Subscribe from "./Subscribe/Subscribe.tsx" +import PureFooter from "./PureFooter/PureFooter.tsx" +import i18next from "i18next" +--- + +
+ + +
diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx deleted file mode 100644 index 9c6b422b7..000000000 --- a/src/components/Footer/Footer.tsx +++ /dev/null @@ -1,15 +0,0 @@ -// import PureFooter from "./PureFooter" -import React, { useState, useCallback } from "react" -import Subscribe from "./Subscribe/Subscribe.tsx" -import PureFooter from "./PureFooter/PureFooter.tsx" - -const Footer = () => { - return ( - <> - - - - ) -} - -export default Footer diff --git a/src/components/Footer/PureFooter/PureFooter.tsx b/src/components/Footer/PureFooter/PureFooter.tsx index ee126d83f..6ce32e8b2 100644 --- a/src/components/Footer/PureFooter/PureFooter.tsx +++ b/src/components/Footer/PureFooter/PureFooter.tsx @@ -1,6 +1,7 @@ import { useState, useEffect } from "preact/hooks" import { aboutList, mediaList, resourceList } from "../helper.tsx" import styles from "./PureFooter.module.css" +import { t } from "i18next" const Footer = () => { return ( @@ -9,28 +10,28 @@ const Footer = () => {
-

About Scroll

+

{ t("footer.aboutScroll.title") }

-

Resources

+

{ t("footer.resources.title") }

-

Follow Us

+

{ t("footer.followUs.title") }

{mediaList.map((item) => ( @@ -39,8 +40,6 @@ const Footer = () => { ))}
- -

© Version 1.0.0 Scroll Ltd 2023

) } diff --git a/src/components/Footer/Subscribe/EmailInput.tsx b/src/components/Footer/Subscribe/EmailInput.tsx index 8905a6049..b177f6914 100644 --- a/src/components/Footer/Subscribe/EmailInput.tsx +++ b/src/components/Footer/Subscribe/EmailInput.tsx @@ -2,6 +2,7 @@ import React from "react" import styles from "./EmailInput.module.css" import ArrowSvg from "~/assets/svgs/footer/arrow-right.svg?react" import { clsx } from "~/lib" +import { t } from "i18next" const EmailInput = (props) => { const { end, onClick, onEnter, ...restProps } = props @@ -23,7 +24,7 @@ const EmailInput = (props) => { -
Thank you for subscribing!
+
{ t("landing.NewsletterCTA.thankYouForSubscribing") }
{ return emailRegex.test(email) } -export default function Subscribe() { +export default function Subscribe(props) { const [email, setEmail] = useState("") const [customMessage, setCustomMessage] = useState("") const [emailValid, setEmailValid] = useState(false) + i18next.changeLanguage(props.lang) + useEffect(() => { setCustomMessage("") setEmailValid(isValidEmail(email)) @@ -26,9 +29,9 @@ export default function Subscribe() { const handleSubmit = (subscribe) => { if (!email) { - setCustomMessage("Please insert your email.") + setCustomMessage(t("landing.NewsletterCTA.pleaseInsertEmail")) } else if (!emailValid) { - setCustomMessage("Please use a correct email address.") + setCustomMessage(t("landing.NewsletterCTA.correctEmail")) } else { subscribe({ EMAIL: email }) setEmail("") @@ -47,9 +50,9 @@ export default function Subscribe() {
-
Stay up-to-date on the latest Scroll Developer news
+
{ t("landing.NewsletterCTA.title") }
- Roadmap updates, virtual and live events, ecosystem opportunities and more + { t("landing.NewsletterCTA.text") }
handleSubmit(subscribe)} onEnter={() => handleSubmit(subscribe)} - placeholder="your email address here" + placeholder= { t("landing.NewsletterCTA.placeholder") } end={status === "success"} /> {customMessage &&
{customMessage}
} - {status === "error" &&
{message}
} + {status === "error" &&
{t(message)}
} )} /> diff --git a/src/components/Footer/helper.tsx b/src/components/Footer/helper.tsx index c195d7dac..c49d5239d 100644 --- a/src/components/Footer/helper.tsx +++ b/src/components/Footer/helper.tsx @@ -23,38 +23,38 @@ const TwitterIcon: React.FC> = (props) => ( export const aboutList = [ { - name: "Bug Bounty", + name: "footer.aboutScroll.bugBounty", href: "https://immunefi.com/bounty/scroll/", }, { - name: "Join Us", + name: "footer.aboutScroll.joinUs", href: "https://jobs.lever.co/ScrollFoundation", }, { - name: "Health Status", + name: "footer.aboutScroll.healthStatus", href: "https://status.scroll.io/", }, { - name: "Privacy Policy", + name: "footer.aboutScroll.privacyPolicy", href: "https://scroll.io/privacy-policy", }, { - name: "Terms and Conditions", + name: "footer.aboutScroll.termsAndConditions", href: "https://scroll.io/terms-and-conditions", }, ] export const resourceList = [ { - name: "Blog", + name: "footer.resources.blog", href: "https://scroll.io/blog", }, { - name: "Documentation", + name: "footer.resources.documentation", href: "https://docs.scroll.io/", }, { - name: "Press Kit", + name: "footer.resources.pressKit", href: "https://scrollzkp.notion.site/Scroll-Rebrand-Assets-5bb83465f56f40989c4f772b39ed3a06", }, ] diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro index 430a70354..0433515cd 100644 --- a/src/components/Header/Header.astro +++ b/src/components/Header/Header.astro @@ -76,8 +76,10 @@ const section = frontmatter?.section ?? "" ) } - - + + + +
diff --git a/src/components/Header/LanguageSelector/LanguageSelector.astro b/src/components/Header/LanguageSelector/LanguageSelector.astro index 874a80472..c34f94314 100644 --- a/src/components/Header/LanguageSelector/LanguageSelector.astro +++ b/src/components/Header/LanguageSelector/LanguageSelector.astro @@ -3,93 +3,136 @@ import i18next from "i18next" import { localizePath } from "astro-i18next" import localeEmoji from "locale-emoji" import ISO6991 from "iso-639-1" +import { clsx } from "~/lib" const supportedLanguages = i18next.languages -const currentLanguage = i18next.language const { pathname } = Astro.url -const { showFlag = false, languageMapping, ...attributes } = Astro.props ---- +const { showFlag = false, languageMapping } = Astro.props +const { dark } = Astro.props + +const getLabel = (language) => { + const flag = showFlag ? localeEmoji(language) + " " : "" + let nativeName = "" + if (languageMapping && languageMapping.hasOwnProperty(language)) { + nativeName = languageMapping[language] + } else { + nativeName = ISO6991.getNativeName(language) + } -
-
    - { - supportedLanguages.map((supportedLanguage) => { - let value = localizePath(pathname, supportedLanguage) - const flag = showFlag ? localeEmoji(supportedLanguage) + " " : "" - let nativeName = "" - if (languageMapping && languageMapping.hasOwnProperty(supportedLanguage)) { - nativeName = languageMapping[supportedLanguage] - } else { - nativeName = ISO6991.getNativeName(supportedLanguage) - } + return flag + nativeName +} +--- - const label = flag + nativeName +
    +
    + + + + {getLabel(supportedLanguages[0])} +
    +
    +
      + { + supportedLanguages.map((supportedLanguage, idx) => { + let value = localizePath(pathname, supportedLanguage) + const label = getLabel(supportedLanguage) - return ( -
    • - {label} -
    • - ) - }) - } -
    + return ( +
  • + {idx === 0 ? ( + + + + + ) : ( + + + + )} + {label} +
  • + ) + }) + } +
+
diff --git a/src/components/Header/Search/Search.module.css b/src/components/Header/Search/Search.module.css index 3aad23a44..59cb45200 100644 --- a/src/components/Header/Search/Search.module.css +++ b/src/components/Header/Search/Search.module.css @@ -244,9 +244,9 @@ } @media (max-width: 72em) and (min-width: 50em) { - :global(.right-box .tools) { + /* :global(.right-box .tools) { display: none; - } + } */ .queryResults { grid-template-columns: 1fr !important; diff --git a/src/layouts/HomeLayout.astro b/src/layouts/HomeLayout.astro index 1c489978a..8f5c51e4e 100644 --- a/src/layouts/HomeLayout.astro +++ b/src/layouts/HomeLayout.astro @@ -3,7 +3,7 @@ import HeadCommon from "../components/HeadCommon.astro" import HeadSEO from "../components/HeadSEO.astro" import Header from "../components/Header/Header.astro" import * as CONFIG from "../config" -import Footer from "~/components/Footer/Footer" +import Footer from "~/components/Footer/Footer.astro" import LeftSidebar from "../components/LeftSidebar/LeftSidebar.astro" const { content = {} } = Astro.props @@ -23,6 +23,7 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site) body { --doc-padding: 65px; } + .home-layout { margin-bottom: 0; } @@ -77,6 +78,6 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site)
-