feat: translations
All checks were successful
ci / docker (push) Successful in 4m4s

This commit is contained in:
Tine Jozelj 2023-09-12 18:27:00 +02:00
parent 28de2a0e50
commit 45c0f6dd30
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
10 changed files with 497 additions and 49 deletions

View file

@ -106,6 +106,11 @@ const config = {
},
{ to: "/blog", label: "Blog", position: "left" },
{ type: "custom-status-navbar-item", position: "left" },
{
type: "search",
position: "right",
},
{
type: "localeDropdown",
position: "right",

View file

@ -258,6 +258,41 @@
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.SearchPage.existingResultsTitle": {
"message": "Search results for \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Search the documentation",
"description": "The search page title for empty query"
},
"theme.SearchPage.searchContext.everywhere": {
"message": "everywhere"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "1 document found|{count} documents found",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.noResultsText": {
"message": "No documents were found",
"description": "The paragraph for empty search result"
},
"theme.SearchBar.noResultsText": {
"message": "No results"
},
"theme.SearchBar.seeAll": {
"message": "See all results"
},
"theme.SearchBar.seeAllOutsideContext": {
"message": "See results outside {context}"
},
"theme.SearchBar.searchInContext": {
"message": "See all results in {context}"
},
"theme.SearchBar.label": {
"message": "Search",
"description": "The ARIA label and placeholder for search button"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Try again",
"description": "The label of the button to try again rendering when the React error boundary captures an error"
@ -269,5 +304,32 @@
"theme.tags.tagsPageTitle": {
"message": "Tags",
"description": "The title of the tag list page"
},
"navbar.status.ok": {
"message": "Ok",
"description": "Text representing ok status"
},
"navbar.status.issues": {
"message": "Issues",
"description": "Text representing issues status"
},
"navbar.status": {
"message": "Status",
"description": "Navbar item that links to status page"
},
"home.signIn": {
"message": "Sign In"
},
"home.requestAccess": {
"message": "Request Access"
},
"home.descriptionTitle": {
"message": "What is this?"
},
"home.descriptionContent": {
"message": "We are non-profit provider of cloud services for select public. Our goal is to provide well integrated and coherent suite of applications that can rival offers of propriatery and for-profit companies. We use and build on top of open source software."
},
"home.tagline": {
"message": "Your personal space in the cloud."
}
}

View file

@ -2,17 +2,5 @@
"version.label": {
"message": "Next",
"description": "The label for version current"
},
"sidebar.tutorialSidebar.category.Tutorial - Basics": {
"message": "Tutorial - Basics",
"description": "The label for category Tutorial - Basics in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Tutorial - Basics.link.generated-index.description": {
"message": "5 minutes to learn the most important Docusaurus concepts.",
"description": "The generated-index page description for category Tutorial - Basics in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Tutorial - Extras": {
"message": "Tutorial - Extras",
"description": "The label for category Tutorial - Extras in sidebar tutorialSidebar"
}
}

View file

@ -1,23 +1,23 @@
{
"link.title.Docs": {
"message": "Docs",
"description": "The title of the footer links column with title=Docs in the footer"
"link.title.Articles": {
"message": "Articles",
"description": "The title of the footer links column with title=Articles in the footer"
},
"link.title.Community": {
"message": "Community",
"description": "The title of the footer links column with title=Community in the footer"
},
"link.item.label.Tutorial": {
"message": "Tutorial",
"description": "The label of footer link with label=Tutorial linking to /docs/intro"
"link.item.label.Documentation": {
"message": "Documentation",
"description": "The label of footer link with label=Documentation linking to /docs/home"
},
"link.item.label.Matrix Chat": {
"message": "Matrix Chat",
"description": "The label of footer link with label=Matrix Chat linking to https://matrix.to/#/#hello:tjo.space"
"link.item.label.Blog": {
"message": "Blog",
"description": "The label of footer link with label=Blog linking to /blog"
},
"link.item.label.Public Source Code": {
"message": "Public Source Code",
"description": "The label of footer link with label=Public Source Code linking to https://code.tjo.space/tjo-space"
"link.item.label.Matrix Room #hello:tjo.space": {
"message": "Matrix Room #hello:tjo.space",
"description": "The label of footer link with label=Matrix Room #hello:tjo.space linking to https://matrix.to/#/#hello:tjo.space"
},
"copyright": {
"message": "Copyright © 2023 tjo.space. Built with Docusaurus.",

View file

@ -3,16 +3,12 @@
"message": "tjo.space logo",
"description": "The alt text of navbar logo"
},
"item.label.Tutorial": {
"message": "Tutorial",
"description": "Navbar item with label Tutorial"
"item.label.Documentation": {
"message": "Documentation",
"description": "Navbar item with label Documentation"
},
"item.label.Blog": {
"message": "Blog",
"description": "Navbar item with label Blog"
},
"item.label.Sign In": {
"message": "Sign In",
"description": "Navbar item with label Sign In"
}
}

335
i18n/sl/code.json Normal file
View file

@ -0,0 +1,335 @@
{
"theme.ErrorPageContent.title": {
"message": "This page crashed.",
"description": "The title of the fallback page when the page crashed"
},
"theme.NotFound.title": {
"message": "Stran ni bila najdena.",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "Nismo našli kar iščete.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "Prosimo kontaktirajte lastnika spletne strani, ki vas je poslala sem da je njihova povezava napacna.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "note",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "tip",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "danger",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "info",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "caution",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.blog.archive.title": {
"message": "Archive",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
"message": "Archive",
"description": "The page & hero description of the blog archive page"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Scroll back to top",
"description": "The ARIA label for the back to top button"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Blog list page navigation",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Newer Entries",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Older Entries",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Blog post page navigation",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Newer Post",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Older Post",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.post.plurals": {
"message": "One post|{count} posts",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.blog.tagTitle": {
"message": "{nPosts} tagged with \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "View All Tags",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "Switch between dark and light mode (currently {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "dark mode",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "light mode",
"description": "The name for the light color mode"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "Breadcrumbs",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} items",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
"message": "Docs pages",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Previous",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Next",
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "One doc tagged|{count} docs tagged",
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.tagDocListPageTitle": {
"message": "{nDocsTagged} with \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "Version: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "This is unreleased documentation for {siteTitle} {versionLabel} version.",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "latest version",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Uredi to stran",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Direct link to {heading}",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": "dne {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": "{user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Nazadnje je posodobil {byUser} {atDate}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "Versions",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.tags.tagsListLabel": {
"message": "Značke:",
"description": "The label alongside a tag list"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Zapri",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "Blog recent posts navigation",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.CodeBlock.copied": {
"message": "Kopirano",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Kopiraj kodo v odložišče",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copy": {
"message": "Kopiraj",
"description": "The copy button label on code blocks"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.NavBar.navAriaLabel": {
"message": "Glavni",
"description": "The ARIA label for the main navigation"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "Jeziki",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "Na tej strani",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.blog.post.readMore": {
"message": "Preberi več",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.readMoreLabel": {
"message": "Preberi več o {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readingTime.plurals": {
"message": "Čas branja eno minuto|2 minuti branja|{readingTime} minut branja",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.breadcrumbs.home": {
"message": "Domača stran",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Zapri stranski meni",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Zapri stranski meni",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.navAriaLabel": {
"message": "Stranski meni",
"description": "The ARIA label for the sidebar navigation"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "Close navigation bar",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← Nazaj na glavni meni",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.SearchPage.existingResultsTitle": {
"message": "Search results for \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Search the documentation",
"description": "The search page title for empty query"
},
"theme.SearchPage.searchContext.everywhere": {
"message": "everywhere"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "1 dokument najden|2 dokumenta najdena|{count} dokumenti najdeni",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.noResultsText": {
"message": "No documents were found",
"description": "The paragraph for empty search result"
},
"theme.SearchBar.noResultsText": {
"message": "Ni rezultatov"
},
"theme.SearchBar.seeAll": {
"message": "Poglej vse rezultate"
},
"theme.SearchBar.seeAllOutsideContext": {
"message": "Poglej rezultate izven {context}"
},
"theme.SearchBar.searchInContext": {
"message": "Poglej rezultate znotraj {context}"
},
"theme.SearchBar.label": {
"message": "Iskanje",
"description": "The ARIA label and placeholder for search button"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Poskusi ponovno",
"description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.common.skipToMainContent": {
"message": "Skip to main content",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.tags.tagsPageTitle": {
"message": "Značke",
"description": "The title of the tag list page"
},
"navbar.status.ok": {
"message": "Ok",
"description": "Text representing ok status"
},
"navbar.status.issues": {
"message": "Tezave",
"description": "Text representing issues status"
},
"navbar.status": {
"message": "Stanje",
"description": "Navbar item that links to status page"
},
"home.signIn": {
"message": "Prijava"
},
"home.requestAccess": {
"message": "Zaprosi za dostop"
},
"home.descriptionTitle": {
"message": "Kaj je to?"
},
"home.descriptionContent": {
"message": "We are non-profit provider of cloud services for select public. Our goal is to provide well integrated and coherent suite of applications that can rival offers of propriatery and for-profit companies. We use and build on top of open source software."
},
"home.tagline": {
"message": "Tvoj osebni prostor v oblaku."
}
}

View file

@ -0,0 +1,26 @@
{
"link.title.Articles": {
"message": "Articles",
"description": "The title of the footer links column with title=Articles in the footer"
},
"link.title.Community": {
"message": "Community",
"description": "The title of the footer links column with title=Community in the footer"
},
"link.item.label.Documentation": {
"message": "Documentation",
"description": "The label of footer link with label=Documentation linking to /docs/home"
},
"link.item.label.Blog": {
"message": "Blog",
"description": "The label of footer link with label=Blog linking to /blog"
},
"link.item.label.Matrix Room #hello:tjo.space": {
"message": "Matrix Room #hello:tjo.space",
"description": "The label of footer link with label=Matrix Room #hello:tjo.space linking to https://matrix.to/#/#hello:tjo.space"
},
"copyright": {
"message": "Copyright © 2023 tjo.space. Built with Docusaurus.",
"description": "The footer copyright"
}
}

View file

@ -0,0 +1,14 @@
{
"logo.alt": {
"message": "tjo.space logo",
"description": "The alt text of navbar logo"
},
"item.label.Documentation": {
"message": "Dokumentacija",
"description": "Navbar item with label Documentation"
},
"item.label.Blog": {
"message": "Blog",
"description": "Navbar item with label Blog"
}
}

View file

@ -1,13 +1,25 @@
import clsx from "clsx";
import Translate, { translate } from "@docusaurus/Translate";
import React, { useEffect, useState } from "react";
function Healthy({ healthy }) {
if (healthy) return <span className="badge badge--success">Ok</span>;
const statusOk = translate({
id: "navbar.status.ok",
message: "Ok",
description: "Text representing ok status",
});
return <span className="badge badge--warning">Issues</span>;
const statusIssues = translate({
id: "navbar.status.issues",
message: "Issues",
description: "Text representing issues status",
});
if (healthy) return <span className="badge badge--success">{statusOk}</span>;
return <span className="badge badge--warning">{statusIssues}</span>;
}
function Mobile({ healthy }) {
function Mobile({ healthy, status }) {
return (
<li className="menu__list-item">
<a
@ -15,7 +27,8 @@ function Mobile({ healthy }) {
href="https://status.tjo.space"
style={{ display: "inline-block", width: "100%" }}
>
Status <Healthy healthy={healthy}></Healthy>
{status}
<Healthy healthy={healthy}></Healthy>
</a>
</li>
);
@ -27,6 +40,12 @@ export default function CustomStatusNavbarItem(props: {
}): JSX.Element | null {
const [healthy, setHealthy] = useState(true);
const statusText = translate({
id: "navbar.status",
message: "Status",
description: "Navbar item that links to status page",
});
useEffect(() => {
fetch(
"https://api.github.com/repos/tjo-space/status/issues?status=open&label=status"
@ -35,11 +54,12 @@ export default function CustomStatusNavbarItem(props: {
.then((issues) => setHealthy(issues.length === 0));
}, []);
if (props.mobile) return <Mobile healthy={healthy}></Mobile>;
if (props.mobile)
return <Mobile healthy={healthy} status={statusText}></Mobile>;
return (
<a className="navbar__item navbar__link" href="https://status.tjo.space">
Status <Healthy healthy={healthy}></Healthy>
{statusText} <Healthy healthy={healthy}></Healthy>
</a>
);
}

View file

@ -6,40 +6,40 @@ import Layout from "@theme/Layout";
import HomepageFeatures from "@site/src/components/HomepageFeatures";
import styles from "./index.module.css";
import Translate, { translate } from "@docusaurus/Translate";
function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
const Logo = require("@site/static/img/logo-light.svg").default;
return (
<header className={clsx("hero hero--primary", styles.heroBanner)}>
<div className="container">
<Logo className={styles.heroLogo} role="img" />
<p className="hero__subtitle">{siteConfig.tagline}</p>
<p className="hero__subtitle">
<Translate id="home.tagline"></Translate>
</p>
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="https://id.tjo.space"
>
Sign In
<Translate id="home.signIn"></Translate>
</Link>
<Link
className="button button--primary button--lg"
to="/request-access"
>
Request Access
<Translate id="home.requestAccess"></Translate>
</Link>
</div>
</div>
<div className={clsx("container", styles.description)}>
<h2>What is this?</h2>
<p>We are non-profit provider of cloud services for select public.</p>
<h2>
<Translate id="home.descriptionTitle"></Translate>
</h2>
<p>
Our goal is to provide well integrated and coherent suite of
applications <br /> that can rival offers of propriatery and
for-profit companies.
<Translate id="home.descriptionContent"></Translate>
</p>
<p>We use and build on top of open source software.</p>
<p>
You can read more about our{" "}
<Link className={styles.descriptionLink} to="/docs/architecture">
@ -62,8 +62,10 @@ function HomepageHeader() {
export default function Home(): JSX.Element {
const { siteConfig } = useDocusaurusContext();
const title = translate({ id: "home.tagline" });
const description = translate({ id: "home.descriptionContent" });
return (
<Layout title={siteConfig.title} description={siteConfig.tagline}>
<Layout title={title} description={description}>
<HomepageHeader />
<main>
<HomepageFeatures />