Skip to content

chore: move translations file and this documentation to i18n folder #480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ You can customize the appearance of all your cards however you wish with URL par
</tr>
<tr>
<td><p align="left"><code>locale</code></p></td>
<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>
<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>
<td><p align="center"><code>enum</code></p></td>
<td><p align="center"><code>en</code></p></td>
</tr>
Expand Down Expand Up @@ -321,7 +321,7 @@ You can pass a query parameter `&show=` to show any specific additional stats wi
</tr>
</table>

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).
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).

```markdown
![GitHub Stats](https://gh-readme-profile.vercel.app/api?username=FajarKim&locale=id)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions scripts/generate-translation-doc.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from "fs";
import locales from "../src/translations";
import languageNames from "./languageNames";
import locales from "../i18n/index";
import languageNames from "../i18n/languageNames";

const TARGET_FILE = "./docs/translations.md";
const TARGET_FILE = "./i18n/README.md";

function generateTranslationsMarkdown(locale: string): string {
return `${locale}`;
Expand Down
2 changes: 1 addition & 1 deletion src/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/card.test.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion tests/renderDocsReadme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ describe("Test Generate Readme Docs", () => {
it("should generate the README content locales correctly", () => {
const generatedReadme = generateReadmeLocales();

expect(fs.writeFileSync).toHaveBeenCalledWith("./docs/translations.md", generatedReadme);
expect(fs.writeFileSync).toHaveBeenCalledWith("./i18n/README.md", generatedReadme);
});
});
2 changes: 1 addition & 1 deletion tests/renderStatsCard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Loading