Skip to content

Commit

Permalink
[update] updating docs tree in website localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Animenosekai committed Jun 28, 2022
1 parent f1c9a3d commit d887610
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 6 deletions.
2 changes: 1 addition & 1 deletion website/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Configuration = {
},
repo: {
// branch: "website"
branch: "59d190ee0972ab8a0cb56c69c793063869f1ae5d"
branch: "f1c9a3db0ea71c6f727e37919d0c6cd8f8d15429"
}
}

Expand Down
20 changes: 18 additions & 2 deletions website/localizations/eng.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class EnglishLocalization {
language: string = "eng";
alpha2: string = "en";
name: string = "English";
docsTranslated: boolean = true
placeholders = {
translationTextArea: 'Enter your text to translate...',
}
Expand Down Expand Up @@ -55,7 +56,20 @@ class EnglishLocalization {
{ name: "README" },
{ name: "JSON" },
{ name: "Shell" },
{ name: "Server" }
{ name: "Server" },
{
name: "Server Documentation",
children: [
{ name: "Getting Started" },
{
name: "Sections",
children: [
{ name: "Language" },
{ name: "Translation" }
]
}
]
}
]
},
{
Expand All @@ -69,10 +83,12 @@ class EnglishLocalization {
{ name: "Objects" },
{ name: "Rate Limits" },
{
name: "sections",
name: "Sections",
children: [
{ name: "Language" },
{ name: "Translation" },
{ name: "Stars" },
{ name: "Stats" }
]
}
]
Expand Down
60 changes: 59 additions & 1 deletion website/localizations/fra.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import EnglishLocalization from "./eng";
import EnglishLocalization, { DocumentationElement } from "./eng";

import { TemplateString } from "utils/string";

class FrenchLocalization extends EnglishLocalization {
language: string = "fra";
alpha2: string = "fr";
name: string = "Français";
docsTranslated: boolean = true
placeholders = {
translationTextArea: 'Entrez le texte à traduire...',
}
Expand Down Expand Up @@ -32,6 +34,62 @@ class FrenchLocalization extends EnglishLocalization {
notifications: { copied: string; } = {
copied: "Copié dans le presse-papier"
}

documentation: DocumentationElement[] = [
{ name: "README" },
{
name: "Documentation Python",
children: [
{ name: "README" },
{ name: "Installation" },
{ name: "References" },
{ name: "Plugins" }
]
},
{
name: "Utilisation par CLI",
children: [
{ name: "README" },
{ name: "JSON" },
{ name: "Shell" },
{ name: "Serveur" },
{
name: "Documentation du Serveur",
children: [
{ name: "Pour commencer" },
{
name: "Sections",
children: [
{ name: "Language" },
{ name: "Translation" }
]
}
]
},
]
},
{
name: "Utilisation du site"
},
{
name: "Documentation d'API",
children: [
{ name: "README" },
{ name: "Pour commencer" },
{ name: "Objects" },
{ name: "Rate Limits" },
{
name: "Sections",
children: [
{ name: "Language" },
{ name: "Translation" },
{ name: "Stars" },
{ name: "Stats" }
]
}
]
}
]
}

export default FrenchLocalization
60 changes: 59 additions & 1 deletion website/localizations/jpn.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import EnglishLocalization from "./eng";
import EnglishLocalization, { DocumentationElement } from "./eng";

import { TemplateString } from "utils/string";

class JapaneseLocalization extends EnglishLocalization {
language: string = "jpn";
alpha2: string = "ja";
name: string = "日本語";
docsTranslated: boolean = true
placeholders = {
translationTextArea: '翻訳する文章を入力してください...',
}
Expand Down Expand Up @@ -32,6 +34,62 @@ class JapaneseLocalization extends EnglishLocalization {
notifications: { copied: string; } = {
copied: "クリップボードにコピーしました"
}

documentation: DocumentationElement[] = [
{ name: "README" },
{
name: "Pythonドキュメント",
children: [
{ name: "README" },
{ name: "Installation" },
{ name: "References" },
{ name: "Plugins" }
]
},
{
name: "CLIでの利用",
children: [
{ name: "README" },
{ name: "JSON" },
{ name: "Shell" },
{ name: "Server" },
{
name: "サーバーのドキュメント",
children: [
{ name: "はじめに" },
{
name: "セクション",
children: [
{ name: "Language" },
{ name: "Translation" }
]
}
]
}
]
},
{
name: "サイトでの利用"
},
{
name: "APIドキュメント",
children: [
{ name: "README" },
{ name: "はじめに" },
{ name: "Objects" },
{ name: "Rate Limits" },
{
name: "セクション",
children: [
{ name: "Language" },
{ name: "Translation" },
{ name: "Stars" },
{ name: "Stats" }
]
}
]
}
]
}

export default JapaneseLocalization
1 change: 1 addition & 0 deletions website/localizations/spa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class SpanishLocalization extends EnglishLocalization {
language: string = "spa";
alpha2: string = "es";
name: string = "Español";
docsTranslated: boolean = true
placeholders = {
translationTextArea: 'Introduce el texto a traducir...',
}
Expand Down
2 changes: 1 addition & 1 deletion website/pages/documentation/[...path].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Documentation: NextPage = () => {
if (!resultPath.endsWith(".md")) {
resultPath += "/README.md"
}
fetch(`https://cdn.jsdelivr.net/gh/Animenosekai/translate@${encodeURIComponent(Configuration.repo.branch)}/docs/${encodeURIComponent(strings.name)}${resultPath}`)
fetch(`https://cdn.jsdelivr.net/gh/Animenosekai/translate@${encodeURIComponent(Configuration.repo.branch)}/docs/${encodeURIComponent(strings.docsTranslated ? strings.name : "English")}${resultPath}`)
.then(response => response.text())
.then(text => {
if (path.join("|") === __path__) {
Expand Down

1 comment on commit d887610

@vercel
Copy link

@vercel vercel bot commented on d887610 Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.