Skip to content

Commit 880d27d

Browse files
authored
chore: move translations file and this documentation to i18n folder (#480)
1 parent 30e3865 commit 880d27d

10 files changed

+10
-10
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ To contribute your theme you need to edit the [themes/index.ts](/themes/index.ts
3535
## 🗣️ Translations Contribution
3636
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).
3737

38-
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.
38+
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.
3939

4040
## 📑 Any contributions you make will be under the MIT Software License
4141

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ You can customize the appearance of all your cards however you wish with URL par
136136
</tr>
137137
<tr>
138138
<td><p align="left"><code>locale</code></p></td>
139-
<td><p align="left">Sets the language in the card, you can check full list of available locales <a href="/docs/translations.md">here</a>.</p></td>
139+
<td><p align="left">Sets the language in the card, you can check full list of available locales <a href="/i18n/README.md">here</a>.</p></td>
140140
<td><p align="center"><code>enum</code></p></td>
141141
<td><p align="center"><code>en</code></p></td>
142142
</tr>
@@ -321,7 +321,7 @@ You can pass a query parameter `&show=` to show any specific additional stats wi
321321
</tr>
322322
</table>
323323

324-
See [more](/docs/translations.md) available locale. The locale code added to file should be a 2-letter abbreviation from [ISO 639-1](https://www.andiamo.co.uk/resources/iso-language-codes/) or a 4-letter code with a language and country code (eg. `id` or `pt-BR`). Anything appearing in [the list](https://gist.github.com/FajarKim/91516c2aecbfc8bf65f584d528d5f2b1) should be fine. You can also contribute new translations if you like, contributing guidelines can be found [here](/CONTRIBUTING.md#%EF%B8%8F-translations-contribution).
324+
See [more](/i18n/README.md) available locale. The locale code added to file should be a 2-letter abbreviation from [ISO 639-1](https://www.andiamo.co.uk/resources/iso-language-codes/) or a 4-letter code with a language and country code (eg. `id` or `pt-BR`). Anything appearing in [the list](https://gist.github.com/FajarKim/91516c2aecbfc8bf65f584d528d5f2b1) should be fine. You can also contribute new translations if you like, contributing guidelines can be found [here](/CONTRIBUTING.md#%EF%B8%8F-translations-contribution).
325325

326326
```markdown
327327
![GitHub Stats](https://gh-readme-profile.vercel.app/api?username=FajarKim&locale=id)
File renamed without changes.
File renamed without changes.
File renamed without changes.

scripts/generate-translation-doc.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import fs from "fs";
2-
import locales from "../src/translations";
3-
import languageNames from "./languageNames";
2+
import locales from "../i18n/index";
3+
import languageNames from "../i18n/languageNames";
44

5-
const TARGET_FILE = "./docs/translations.md";
5+
const TARGET_FILE = "./i18n/README.md";
66

77
function generateTranslationsMarkdown(locale: string): string {
88
return `${locale}`;

src/card.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import sharp from "sharp";
22
import parseBoolean from "@barudakrosul/parse-boolean";
33
import type { GetData } from "./getData";
44
import type { UiConfig } from "../api/index";
5-
import { locales, Locales } from "./translations";
5+
import { locales, Locales } from "../i18n/index";
66
import icons from "./icons";
77

88
/**

tests/card.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import card from "../src/card";
2-
import locales from "../src/translations";
2+
import locales from "../i18n/index";
33

44
describe("Test card function", () => {
55
const mockData = {

tests/renderDocsReadme.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ describe("Test Generate Readme Docs", () => {
1515
it("should generate the README content locales correctly", () => {
1616
const generatedReadme = generateReadmeLocales();
1717

18-
expect(fs.writeFileSync).toHaveBeenCalledWith("./docs/translations.md", generatedReadme);
18+
expect(fs.writeFileSync).toHaveBeenCalledWith("./i18n/README.md", generatedReadme);
1919
});
2020
});

tests/renderStatsCard.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import getData from "../src/getData";
33
import type { User } from "../src/fetcher/stats";
44
import card from "../src/card";
55
import themes from "../themes/index";
6-
import locales from "../src/translations";
6+
import locales from "../i18n/index";
77

88
jest.mock("../src/getData");
99
jest.mock("../src/card");

0 commit comments

Comments
 (0)