From 48d6c08eaa30b40c07f87891af00b7d8b4dc1e7b Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 31 Mar 2021 15:23:58 -0400 Subject: [PATCH] Using correct docs language. Fixes #42 --- Dockerfile | 1 + lemmy-translations | 2 +- src/shared/components/link-line.tsx | 7 +++++-- src/shared/components/main.tsx | 31 +++++++++++++++++++++++++---- src/shared/utils.ts | 5 +++++ 5 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 src/shared/utils.ts diff --git a/Dockerfile b/Dockerfile index c969a83..6100835 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,7 @@ COPY tsconfig.json \ ./ COPY joinlemmy-translations joinlemmy-translations +COPY lemmy-translations lemmy-translations COPY src src # Copy the docs and API diff --git a/lemmy-translations b/lemmy-translations index 4b82eea..4df9e58 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 4b82eeaaf4762e7a282548b675f40352c1f5ef33 +Subproject commit 4df9e58c57a5104fad7d0f2872042327f54d2a55 diff --git a/src/shared/components/link-line.tsx b/src/shared/components/link-line.tsx index 6fde5dc..da0dd5f 100644 --- a/src/shared/components/link-line.tsx +++ b/src/shared/components/link-line.tsx @@ -1,5 +1,6 @@ import { Component } from "inferno"; import { Link } from "inferno-router"; +import { getDocsLanguage } from "../utils"; import { i18n } from "../i18next"; export class LinkLine extends Component { @@ -12,9 +13,11 @@ export class LinkLine extends Component { {i18n.t("join")} {i18n.t("apps")} {i18n.t("support")} - {i18n.t("docs")} + + {i18n.t("docs")} + {i18n.t("coc")} diff --git a/src/shared/components/main.tsx b/src/shared/components/main.tsx index 29ac5cd..cc0865a 100644 --- a/src/shared/components/main.tsx +++ b/src/shared/components/main.tsx @@ -4,6 +4,7 @@ import { Helmet } from "inferno-helmet"; import { DonateLines } from "./donate-lines"; import { i18n } from "../i18next"; import { T } from "inferno-i18next"; +import { getDocsLanguage } from "../utils"; const title = i18n.t("lemmy_title"); @@ -24,7 +25,9 @@ export class Main extends Component { return ( {i18n.t("run_a_server")} @@ -139,7 +142,14 @@ export class Main extends Component {

{i18n.t("create_discussion_platform")}

- ## + # + + # + # # @@ -179,8 +189,21 @@ export class Main extends Component {

  • - ## - # + # + + # + + + # +
  • {i18n.t("clean_interface")}
  • diff --git a/src/shared/utils.ts b/src/shared/utils.ts new file mode 100644 index 0000000..685cddd --- /dev/null +++ b/src/shared/utils.ts @@ -0,0 +1,5 @@ +let DOCS_LANGUAGES = ["en", "es"]; + +export function getDocsLanguage(lang: string): string { + return DOCS_LANGUAGES.includes(lang) ? lang : "en"; +}