-
Access Private Repos
+
+ {{ t("options.privateRepos.title") }}
+
- Optional: To recalculate the diff on private repos, the
- extension needs a GitHub PAT to authenticate API requests.
+ {{ t("options.privateRepos.description1") }}
+ {{ t("options.privateRepos.description2") }}
Click here {{ t("options.privateRepos.description3") }}
- to create one.
+ {{ t("options.privateRepos.description4") }}
@@ -53,17 +57,23 @@ const tokenHidden = ref(true);
- Token is invalid
+ {{
+ t("options.privateRepos.invalidToken")
+ }}
{{ " " }}
{{ error }}
- Checking token...
+ {{ t("options.privateRepos.checking") }}
-
- Token is valid
+
+ {{
+ t("options.privateRepos.validToken")
+ }}
{{ " " }}
- Username: {{ user?.login }}
+ {{
+ t("options.privateRepos.username", [user.login])
+ }}
diff --git a/src/components/createDiffComponent.ts b/src/components/createDiffComponent.ts
index c5376ef..4fcf80f 100644
--- a/src/components/createDiffComponent.ts
+++ b/src/components/createDiffComponent.ts
@@ -44,10 +44,15 @@ export function createDiffComponent(options: {
if (!hideGeneratedLineCount) {
const generated = document.createElement("strong");
generated.id = DIFF_COMPONENT_ID;
- generated.textContent = options.getGeneratedText(stats.exclude.changes);
+ generated.textContent =
+ " " + options.getGeneratedText(stats.exclude.changes);
generated.style.color = GREY_COLOR;
- const generatedAdditionsText = `+${stats.exclude.additions}`;
- const generatedDeletionsText = `−${stats.exclude.deletions}`;
+ const generatedAdditionsText = i18n.t("diffs.additionsSymbol", [
+ stats.exclude.additions,
+ ]);
+ const generatedDeletionsText = i18n.t("diffs.deletionsSymbol", [
+ stats.exclude.deletions,
+ ]);
generated.title = `${generatedAdditionsText} ${generatedDeletionsText}`;
spinner.replaceWith(generated);
} else {
diff --git a/src/entrypoints/options/index.html b/src/entrypoints/options/index.html
index 2cd0ae2..ab6691c 100644
--- a/src/entrypoints/options/index.html
+++ b/src/entrypoints/options/index.html
@@ -4,7 +4,6 @@
-
Options
diff --git a/src/entrypoints/options/main.ts b/src/entrypoints/options/main.ts
index d372d10..7223e8b 100644
--- a/src/entrypoints/options/main.ts
+++ b/src/entrypoints/options/main.ts
@@ -1,4 +1,6 @@
import Options from "@/pages/Options.vue";
import { VueQueryPlugin } from "@tanstack/vue-query";
+document.title = i18n.t("options.title");
+
createApp(Options).use(VueQueryPlugin).mount(document.body);
diff --git a/src/locales/en.yml b/src/locales/en.yml
new file mode 100644
index 0000000..ede6904
--- /dev/null
+++ b/src/locales/en.yml
@@ -0,0 +1,49 @@
+name: GitHub Better Line Counts
+description: Remove generated files from GitHub line counts
+saveChanges: Save Changes
+discard: Discard
+diffs:
+ additionsText:
+ 1: $1 addition
+ n: $1 additions
+ deletionsText:
+ 1: $1 deletion
+ n: $1 deletions
+ generatedText:
+ 1: $1 generated line.
+ n: $1 generated lines.
+ additionsSymbol: +$1
+ deletionsSymbol: −$1
+ generatedSymbol: ⌁$1
+options:
+ title: Options
+ privateRepos:
+ title: Access Private Repos
+ description1: "Optional:"
+ description2: To recalculate the diff on private repos, the extension needs a GitHub PAT to authenticate API requests.
+ description3: Click here
+ description4: to create one.
+ inputPlaceholder: Personal access token...
+ invalidToken: Token is invalid
+ validToken: Token is valid
+ checking: Checking token...
+ username: "Username: $1"
+ enabled:
+ title: Show Generated Line Counts
+ description1: Along with
+ description2: +additions
+ description3: and
+ description4: −deletions
+ description5: ", show a third number for"
+ description6: ⌁generated
+ description7: lines.
+ customLists:
+ title: Custom Lists
+ description1: Use
+ description2: minimatch
+ description3: glob patterns to mark files as generated across all repos.
+ allRepos: All Repos
+ customRepoPlaceholder: |
+ Enter glob patterns:
+ *.lock
+ **/vendor/**
diff --git a/src/public/icon/16.png b/src/public/icon/16.png
deleted file mode 100644
index b57d4c4..0000000
Binary files a/src/public/icon/16.png and /dev/null differ
diff --git a/src/public/icon/32.png b/src/public/icon/32.png
deleted file mode 100644
index 1851e8f..0000000
Binary files a/src/public/icon/32.png and /dev/null differ
diff --git a/src/public/icon/48.png b/src/public/icon/48.png
deleted file mode 100644
index 28ad6e6..0000000
Binary files a/src/public/icon/48.png and /dev/null differ
diff --git a/src/public/icon/96.png b/src/public/icon/96.png
deleted file mode 100644
index 3bdf3a0..0000000
Binary files a/src/public/icon/96.png and /dev/null differ
diff --git a/wxt.config.ts b/wxt.config.ts
index 00923bc..0d27e0c 100644
--- a/wxt.config.ts
+++ b/wxt.config.ts
@@ -9,7 +9,11 @@ export default defineConfig({
experimental: {
entrypointImporter: "vite-node",
},
- modules: ["@wxt-dev/module-vue"],
+ modules: [
+ "@wxt-dev/module-vue",
+ "@wxt-dev/i18n/module",
+ "@wxt-dev/auto-icons",
+ ],
imports: {
presets: ["vue-router", "@vueuse/core"],
imports: [
@@ -30,7 +34,13 @@ export default defineConfig({
permissions.push("https://api.github.com/*");
}
return {
+ default_locale: "en",
+ name: "__MSG_name__",
+ description: "__MSG_description__",
permissions,
};
},
+ autoIcons: {
+ grayscaleOnDevelopment: false,
+ },
});