diff --git a/src/components/LanguageSwitcher.astro b/src/components/LanguageSwitcher.astro new file mode 100644 index 0000000..86a89b3 --- /dev/null +++ b/src/components/LanguageSwitcher.astro @@ -0,0 +1,25 @@ +--- +import { Icon } from "astro-icon/components"; +import { astroI18n, l } from "astro-i18n"; + +interface Languages { + [U: string]: string +} + +const current = astroI18n.locale; +const languages: Languages = { + cs: "Čeština", + en: "English" +}; +const list = Object.keys(languages); + +function isPrevLang(index: number) { + return (index+1) % list.length == list.indexOf(current); +} +--- + +{ list.map((lang, i) => + + isPrevLang(i) && { languages[lang] } + +) } diff --git a/src/components/Nav.astro b/src/components/Nav.astro index e8db805..d846bb1 100644 --- a/src/components/Nav.astro +++ b/src/components/Nav.astro @@ -1,6 +1,7 @@ --- import { Icon } from 'astro-icon/components'; import NavLink from './NavLink.astro'; +import LanguageSwitcher from './LanguageSwitcher.astro'; import "../styles/nav.css"; import { t, l } from "astro-i18n"; @@ -29,10 +30,13 @@ const nav = [ ) }
  • - { t("nav.status") } + { t("nav.status") }
  • - { t("nav.wiki") } + { t("nav.wiki") } +
  • +
  • +
  • diff --git a/src/i18n/common/en.json b/src/i18n/common/en.json new file mode 100644 index 0000000..5220fce --- /dev/null +++ b/src/i18n/common/en.json @@ -0,0 +1,75 @@ +{ + "nav": { + "home": "Home", + "services": "Services", + "contact": "Contact", + "status": "Status", + "wiki": "Wiki" + }, + "home": { + "meta": { + "title": "CodeSpace.cz - freedom and independence in the digital age" + }, + "header": { + "title": "United by the desire for freedom and independence in the digital age.", + "description": "We run our own network and servers so we don't have to rely on others. We provide various services that respect our privacy." + }, + "services": { + "title": "Services", + "description": "Overview of the main services we operate.", + "more": "The complete list of services can be found on the services page." + } + }, + "services": { + "title": "Services", + "description": "Overview of all services we provide on our infrastructure.", + "public": { + "title": "Public services", + "description": "Overview of all provided public services." + }, + "for_members": { + "title": "Services for members", + "description": "We also provide other services that are primarily intended for our members" + }, + "more": "We can also individually provide you with a wide range of other services.", + "labels": { + "invite": "invite-only" + }, + "piped": { + "title": "Piped", + "description": "An alternative YouTube frontend that doesn't track you and is ad-free." + }, + "pipedmusic": { + "title": "Piped Music", + "description": "Our open-source music client that doesn't share your data with anyone." + }, + "send": { + "title": "Send", + "description": "Send up to 10 GB of files securely and privately with end-to-end encryption." + }, + "forgejo": { + "title": "Forgejo", + "description": "A simple and easy-to-use extension of Git, on which we develop our projects." + }, + "vaultwarden": { + "title": "Vaultwarden", + "description": "Password manager with useful features compatible with Bitwarden." + }, + "plausible": { + "title": "Plausible", + "description": "Website traffic statistics respecting the privacy of visitors." + }, + "nextcloud": { + "title": "Nextcloud", + "description": "File storage with sync options and lots of useful apps." + }, + "webhosting": { + "title": "Webhosting", + "description": "We offer web hosting services on our own platform." + } + }, + "contact": { + "title": "Contact", + "description": "Ways you can contact us." + } +} \ No newline at end of file