Skip to content

Commit

Permalink
chore: add i18next parser (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
icfor authored Nov 14, 2023
1 parent cc655ab commit 4aa6cb4
Show file tree
Hide file tree
Showing 141 changed files with 2,893 additions and 1,494 deletions.
6 changes: 5 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"importOrder": ["^~(.*)$", "^[./]"],
"importOrder": [
"^~(.*)$",
"@(src|utils|components|screens|models|api)",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"],
Expand Down
22 changes: 22 additions & 0 deletions e2e/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ test.describe.parallel("Main Pages", () => {
test("Main components", async ({ page }) => {
await page.goto("/");

await page.waitForTimeout(200);

await expect(page.locator('[data-test="footer"]')).toBeVisible();
await expect(page.locator('[data-test="nav"]')).toBeVisible();
});
Expand All @@ -25,6 +27,8 @@ test.describe.parallel("Main Pages", () => {
test("Main components", async ({ page }) => {
await page.goto("/contact");

await page.waitForTimeout(200);

await expect(page.locator('[data-test="contact-submit"]')).toBeVisible();
});
});
Expand All @@ -33,6 +37,8 @@ test.describe.parallel("Main Pages", () => {
test("Main components", async ({ page }) => {
await page.goto("/developer-tools");

await page.waitForTimeout(200);

await expect(page.locator('[data-test="devtools-cta"]')).toBeVisible();
});
});
Expand All @@ -42,6 +48,8 @@ test.describe.parallel("Blog", () => {
test("Main components", async ({ page }) => {
await page.goto("/blog");

await page.waitForTimeout(200);

expect(
await page.locator('[data-test="post-summary-item"]').count(),
).toBeGreaterThan(1);
Expand All @@ -52,9 +60,23 @@ test.describe.parallel("Staking", () => {
test("Main components", async ({ page }) => {
await page.goto("/staking");

await page.waitForTimeout(200);

expect(
await page.locator('[data-test="network-item"]').count(),
).toBeGreaterThan(1);
expect(await page.locator('[data-test="stats-cards"]').count()).toEqual(1);
});
});

test.describe.parallel("Staking Details", () => {
test("Main components", async ({ page }) => {
await page.goto("/staking/how-to-stake-bld-on-agoric");

await page.waitForTimeout(200);

await expect(
page.locator('[data-test="staking-guide-info"]'),
).toBeVisible();
});
});
23 changes: 23 additions & 0 deletions i18next-parser.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default {
contextSeparator: "_",
createOldCatalogs: false,
customValueTemplate: null,
defaultNamespace: "translation",
defaultValue: "",
failOnUpdate: false,
failOnWarnings: true,
i18nextOptions: null,
indentation: 2,
input: undefined,
keepRemoved: false,
keySeparator: ".",
lineEnding: "auto",
locales: ["en", "zh-HK", "zh-CN"],
namespaceSeparator: ":",
output: "public/locales/$LOCALE/$NAMESPACE.json",
pluralSeparator: "_",
resetDefaultValueLocale: null,
sort: true,
verbose: false,
yamlOptions: null,
};
Loading

0 comments on commit 4aa6cb4

Please sign in to comment.