From 6f4805dda174b3352185cf4c6200b661557e7ad5 Mon Sep 17 00:00:00 2001 From: Rangga Fajar Oktariansyah <86386385+FajarKim@users.noreply.github.com> Date: Sat, 26 Oct 2024 06:07:04 +0700 Subject: [PATCH 1/4] chore: move translations file and this documentation to `i18n` folder --- docs/translations.md => i18n/README.md | 0 src/translations.ts => i18n/index.ts | 0 scripts/generate-translation-doc.ts | 2 +- src/card.ts | 2 +- tests/card.test.ts | 2 +- tests/renderStatsCard.test.ts | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename docs/translations.md => i18n/README.md (100%) rename src/translations.ts => i18n/index.ts (100%) diff --git a/docs/translations.md b/i18n/README.md similarity index 100% rename from docs/translations.md rename to i18n/README.md diff --git a/src/translations.ts b/i18n/index.ts similarity index 100% rename from src/translations.ts rename to i18n/index.ts diff --git a/scripts/generate-translation-doc.ts b/scripts/generate-translation-doc.ts index fdce7e5..c02993d 100644 --- a/scripts/generate-translation-doc.ts +++ b/scripts/generate-translation-doc.ts @@ -1,5 +1,5 @@ import fs from "fs"; -import locales from "../src/translations"; +import locales from "../i18n/index"; import languageNames from "./languageNames"; const TARGET_FILE = "./docs/translations.md"; diff --git a/src/card.ts b/src/card.ts index b6cf5f5..c3c7b6b 100644 --- a/src/card.ts +++ b/src/card.ts @@ -2,7 +2,7 @@ import sharp from "sharp"; import parseBoolean from "@barudakrosul/parse-boolean"; import type { GetData } from "./getData"; import type { UiConfig } from "../api/index"; -import { locales, Locales } from "./translations"; +import { locales, Locales } from "../i18n/index"; import icons from "./icons"; /** diff --git a/tests/card.test.ts b/tests/card.test.ts index f9aa94e..9525145 100644 --- a/tests/card.test.ts +++ b/tests/card.test.ts @@ -1,5 +1,5 @@ import card from "../src/card"; -import locales from "../src/translations"; +import locales from "../i18n/index"; describe("Test card function", () => { const mockData = { diff --git a/tests/renderStatsCard.test.ts b/tests/renderStatsCard.test.ts index 0bc225b..e8975a5 100644 --- a/tests/renderStatsCard.test.ts +++ b/tests/renderStatsCard.test.ts @@ -3,7 +3,7 @@ import getData from "../src/getData"; import type { User } from "../src/fetcher/stats"; import card from "../src/card"; import themes from "../themes/index"; -import locales from "../src/translations"; +import locales from "../i18n/index"; jest.mock("../src/getData"); jest.mock("../src/card"); From 34c23fe9848cd853eba679abc1b2ec10fa8570f3 Mon Sep 17 00:00:00 2001 From: Rangga Fajar Oktariansyah <86386385+FajarKim@users.noreply.github.com> Date: Sat, 26 Oct 2024 06:12:08 +0700 Subject: [PATCH 2/4] update some files --- CONTRIBUTING.md | 2 +- README.md | 4 ++-- scripts/generate-translation-doc.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 85ad483..f0ac012 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,7 +35,7 @@ To contribute your theme you need to edit the [themes/index.ts](/themes/index.ts ## 🗣️ Translations Contribution GitHub Readme Profile supports multiple languages, if we are missing your language, you can contribute it! You can check the currently supported languages [here](/README.md#available-locales). -To contribute your language you need to edit the [src/translations.ts](/src/translations.ts) file and add new property to each object where the key is the language code in ISO 639-1 standard and the value is the translated string. Anything appearing in [the list](https://gist.github.com/FajarKim/91516c2aecbfc8bf65f584d528d5f2b1) should be fine. +To contribute your language you need to edit the [i18n/index.ts](/i18n/index.ts) file and add new property to each object where the key is the language code in ISO 639-1 standard and the value is the translated string. Anything appearing in [the list](https://gist.github.com/FajarKim/91516c2aecbfc8bf65f584d528d5f2b1) should be fine. ## 📑 Any contributions you make will be under the MIT Software License diff --git a/README.md b/README.md index e969489..2ef760b 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ You can customize the appearance of all your cards however you wish with URL par
locale
Sets the language in the card, you can check full list of available locales here.
Sets the language in the card, you can check full list of available locales here.
enum
en