Merge pull request #43 from LemmyNet/correct_docs_language

Using correct docs language. Fixes #42
This commit is contained in:
Nutomic 2021-04-02 12:55:30 +00:00 committed by GitHub
commit 986d236af4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 7 deletions

View file

@ -32,6 +32,7 @@ COPY tsconfig.json \
./ ./
COPY joinlemmy-translations joinlemmy-translations COPY joinlemmy-translations joinlemmy-translations
COPY lemmy-translations lemmy-translations
COPY src src COPY src src
# Copy the docs and API # Copy the docs and API

@ -1 +1 @@
Subproject commit 4b82eeaaf4762e7a282548b675f40352c1f5ef33 Subproject commit 4df9e58c57a5104fad7d0f2872042327f54d2a55

View file

@ -1,5 +1,6 @@
import { Component } from "inferno"; import { Component } from "inferno";
import { Link } from "inferno-router"; import { Link } from "inferno-router";
import { getDocsLanguage } from "../utils";
import { i18n } from "../i18next"; import { i18n } from "../i18next";
export class LinkLine extends Component<any, any> { export class LinkLine extends Component<any, any> {
@ -12,9 +13,11 @@ export class LinkLine extends Component<any, any> {
<Link to="/instances">{i18n.t("join")}</Link> <Link to="/instances">{i18n.t("join")}</Link>
<Link to="/apps">{i18n.t("apps")}</Link> <Link to="/apps">{i18n.t("apps")}</Link>
<Link to="/support">{i18n.t("support")}</Link> <Link to="/support">{i18n.t("support")}</Link>
<a href="/docs/en/index.html">{i18n.t("docs")}</a> <a href={`/docs/${getDocsLanguage(i18n.language)}/index.html`}>
{i18n.t("docs")}
</a>
<a <a
href="/docs/en/code_of_conduct.html" href={`/docs/${getDocsLanguage(i18n.language)}/code_of_conduct.html`}
title={i18n.t("code_of_conduct")} title={i18n.t("code_of_conduct")}
> >
{i18n.t("coc")} {i18n.t("coc")}

View file

@ -4,6 +4,7 @@ import { Helmet } from "inferno-helmet";
import { DonateLines } from "./donate-lines"; import { DonateLines } from "./donate-lines";
import { i18n } from "../i18next"; import { i18n } from "../i18next";
import { T } from "inferno-i18next"; import { T } from "inferno-i18next";
import { getDocsLanguage } from "../utils";
const title = i18n.t("lemmy_title"); const title = i18n.t("lemmy_title");
@ -24,7 +25,9 @@ export class Main extends Component<any, any> {
return ( return (
<a <a
class="button primary" class="button primary"
href="/docs/en/administration/administration.html" href={`/docs/${getDocsLanguage(
i18n.language
)}/administration/administration.html`}
> >
{i18n.t("run_a_server")} {i18n.t("run_a_server")}
</a> </a>
@ -139,7 +142,14 @@ export class Main extends Component<any, any> {
<h2>{i18n.t("create_discussion_platform")}</h2> <h2>{i18n.t("create_discussion_platform")}</h2>
<p> <p>
<T i18nKey="create_discussion_platform_desc"> <T i18nKey="create_discussion_platform_desc">
#<a href="/docs/en/administration/administration.html">#</a> #
<a
href={`/docs/${getDocsLanguage(
i18n.language
)}/administration/administration.html`}
>
#
</a>
<i>#</i> <i>#</i>
<a href="https://en.wikipedia.org/wiki/Fediverse">#</a> <a href="https://en.wikipedia.org/wiki/Fediverse">#</a>
</T> </T>
@ -179,8 +189,21 @@ export class Main extends Component<any, any> {
<ul class="is-marginless"> <ul class="is-marginless">
<li> <li>
<T i18nKey="self_hostable"> <T i18nKey="self_hostable">
#<a href="/docs/en/administration/install_docker.html">#</a> #
<a href="/docs/en/administration/install_ansible.html">#</a> <a
href={`/docs/${getDocsLanguage(
i18n.language
)}/administration/install_docker.html`}
>
#
</a>
<a
href={`/docs/${getDocsLanguage(
i18n.language
)}/administration/install_ansible.html`}
>
#
</a>
</T> </T>
</li> </li>
<li>{i18n.t("clean_interface")}</li> <li>{i18n.t("clean_interface")}</li>

5
src/shared/utils.ts Normal file
View file

@ -0,0 +1,5 @@
let DOCS_LANGUAGES = ["en", "es"];
export function getDocsLanguage(lang: string): string {
return DOCS_LANGUAGES.includes(lang) ? lang : "en";
}