Skip to content

Commit 03b839f

Browse files
authored
i18n improvements: dynamic footer year + Ukrainian ownership updates (#1254)
* feat(i18n): make footer year dynamic across all locales * chore(codeowners): add owner for frontend/i18n/uk
1 parent 701fd5b commit 03b839f

7 files changed

Lines changed: 17 additions & 21 deletions

File tree

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
/frontend/i18n/ar/ @midosvt @ImOver00
1111
/frontend/i18n/sv/ @fusez
1212
/frontend/i18n/vi/ @PHATBENTRE
13+
/frontend/i18n/uk/ @justdawy

frontend/docusaurus.config.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ import { themes as prismThemes } from "prism-react-renderer";
55

66
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
77

8+
const currentYear = new Date().getFullYear();
9+
10+
const copyrightByLocale: Record<string, string> = {
11+
en: `Copyright © ${currentYear} open.mp. Built with Docusaurus.`,
12+
uk: `Copyright © ${currentYear} open.mp. Створено на Docusaurus.`,
13+
"pt-BR": `Copyright © ${currentYear} open.mp. Feito com Docusaurus.`,
14+
"zh-CN": `版权所有 © ${currentYear} open.mp。基于Docusaurus构建"`,
15+
tr: `Telif Hakkı © ${currentYear} open.mp. Docusaurus ile yapıldı.`,
16+
fa: `حق نشر © ${currentYear} open.mp. ساخته شده با Docusaurus.`,
17+
18+
};
19+
820
const config: Config = {
921
title: "open.mp",
1022
tagline: "Open Multiplayer",
@@ -330,7 +342,10 @@ const config: Config = {
330342
],
331343
},
332344
],
333-
copyright: `Copyright © ${new Date().getFullYear()} open.mp. Built with Docusaurus.`,
345+
copyright:
346+
copyrightByLocale[
347+
process.env.DOCUSAURUS_CURRENT_LOCALE || "en"
348+
] || copyrightByLocale.en,
334349
},
335350
prism: {
336351
theme: prismThemes.github,

frontend/i18n/fa/docusaurus-theme-classic/footer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,5 @@
6262
"link.item.label.SA-MP": {
6363
"message": "SA-MP",
6464
"description": "The label of footer link with label=SA-MP linking to https://sa-mp.mp/"
65-
},
66-
"copyright": {
67-
"message": "حق نشر © 2025 open.mp. ساخته شده با Docusaurus.",
68-
"description": "The footer copyright"
6965
}
7066
}

frontend/i18n/pt-BR/docusaurus-theme-classic/footer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,5 @@
6262
"link.item.label.SA-MP": {
6363
"message": "SA-MP",
6464
"description": "The label of footer link with label=SA-MP linking to https://sa-mp.mp/"
65-
},
66-
"copyright": {
67-
"message": "Copyright © 2025 open.mp. Feito com Docusaurus.",
68-
"description": "The footer copyright"
6965
}
7066
}

frontend/i18n/tr/docusaurus-theme-classic/footer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,5 @@
6262
"link.item.label.SA-MP": {
6363
"message": "SA-MP",
6464
"description": "The label of footer link with label=SA-MP linking to https://sa-mp.mp/"
65-
},
66-
"copyright": {
67-
"message": "Telif Hakkı © {year} open.mp. Docusaurus ile yapıldı.",
68-
"description": "The footer copyright"
6965
}
7066
}

frontend/i18n/uk/docusaurus-theme-classic/footer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,5 @@
6262
"link.item.label.SA-MP": {
6363
"message": "SA-MP",
6464
"description": "The label of footer link with label=SA-MP linking to https://sa-mp.mp/"
65-
},
66-
"copyright": {
67-
"message": "Copyright © {year} open.mp. Створено на Docusaurus.",
68-
"description": "The footer copyright"
6965
}
7066
}

frontend/i18n/zh-CN/docusaurus-theme-classic/footer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,5 @@
6262
"link.item.label.SA-MP": {
6363
"message": "SA-MP",
6464
"description": "标签为SA-MP的页脚链接,指向https://sa-mp.mp/"
65-
},
66-
"copyright": {
67-
"message": "版权所有 © 2025 open.mp。基于Docusaurus构建",
68-
"description": "页脚版权信息"
6965
}
7066
}

0 commit comments

Comments
 (0)