forked from mirrored/github-readme-stats
feat: card locale translations (#509)
* Add Card Translations
* Add tests and documentation for `?lang` option
* Card Translations: update Italian
* Run Prettier
* Correct German Translations.
Co-authored-by: schmelto <30869493+schmelto@users.noreply.github.com>
* refactor: added i18n class to manage translation logic & improved code
* Make the new src/translations.js more concise
* Update translations.js
Co-authored-by: schmelto <30869493+schmelto@users.noreply.github.com>
* Revert 4175484d69
* fix: overlap because of language length
Co-authored-by: lrusso96 <russo.1699981@studenti.uniroma1.it>
Co-authored-by: schmelto <30869493+schmelto@users.noreply.github.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>
This commit is contained in:
co-authored by
schmelto
lrusso96
Anurag
parent
2707d07453
commit
f1df178643
@@ -307,4 +307,29 @@ describe("Test renderRepoCard", () => {
|
||||
});
|
||||
expect(queryByTestId(document.body, "badge")).toBeNull();
|
||||
});
|
||||
|
||||
it("should render translated badges", () => {
|
||||
document.body.innerHTML = renderRepoCard(
|
||||
{
|
||||
...data_repo.repository,
|
||||
isArchived: true,
|
||||
},
|
||||
{
|
||||
locale: "cn",
|
||||
},
|
||||
);
|
||||
|
||||
expect(queryByTestId(document.body, "badge")).toHaveTextContent("已封存");
|
||||
|
||||
document.body.innerHTML = renderRepoCard(
|
||||
{
|
||||
...data_repo.repository,
|
||||
isTemplate: true,
|
||||
},
|
||||
{
|
||||
locale: "cn",
|
||||
},
|
||||
);
|
||||
expect(queryByTestId(document.body, "badge")).toHaveTextContent("模板");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user