2 Commits

Author SHA1 Message Date
nick comer d390feeab7 whoops missed en 2024-05-02 20:06:20 -04:00
nick comer 510b98edcc mess with i18n a little bit 2024-05-02 20:03:18 -04:00
4 changed files with 57 additions and 12 deletions
+24
View File
@@ -0,0 +1,24 @@
{
"extension_name": {
"message": "HyperTab",
"description": "The display name for the extension."
},
"extension_description": {
"message": "Schnelle Suche und Wechsel von Registerkarten",
"description": "Description of what the extension does."
},
"ui_open_tabs": {
"message": "Öffnen Sie Registerkarten ($COUNT$)",
"description": "Text denoting the section in the UI of open tabs",
"placeholders": {
"count": {
"content": "$1",
"example": "82"
}
}
},
"ui_search_tabs": {
"message": "Suchregisterkarten",
"description": "Placeholder text in the tab search box"
}
}
+21 -7
View File
@@ -1,10 +1,24 @@
{ {
"extension_name": { "extension_name": {
"message": "HyperTab", "message": "HyperTab",
"description": "The display name for the extension." "description": "The display name for the extension."
}, },
"extension_description": { "extension_description": {
"message": "Quick Tab Search and Switch for Safari", "message": "Quick Tab Search and Switch",
"description": "Description of what the extension does." "description": "Description of what the extension does."
},
"ui_open_tabs": {
"message": "Open Tabs ($COUNT$)",
"description": "Text denoting the section in the UI of open tabs",
"placeholders": {
"count": {
"content": "$1",
"example": "82"
}
} }
},
"ui_search_tabs": {
"message": "Search Tabs",
"description": "Placeholder text in the tab search box"
}
} }
+3 -3
View File
@@ -2,9 +2,9 @@
"manifest_version": 2, "manifest_version": 2,
"default_locale": "en", "default_locale": "en",
"name": "HyperTab", "name": "__MSG_extension_name__",
"description": "Quick tabs search and switch", "description": "__MSG_extension_description__",
"version": "0.1", "version": "@@replaced_by_package_sh",
"icons": { "icons": {
"48": "images/icon-48.png", "48": "images/icon-48.png",
+9 -2
View File
@@ -11,6 +11,13 @@ import ReactDOM from "react-dom/client";
import { useHotkeys } from "react-hotkeys-hook"; import { useHotkeys } from "react-hotkeys-hook";
import "./scrollIntoViewIfNeededPolyfill"; import "./scrollIntoViewIfNeededPolyfill";
function t(
messageName: string,
substitutions?: string | string[] | undefined
): string {
return browser.i18n.getMessage(messageName, substitutions);
}
function hostname(url: string): string { function hostname(url: string): string {
try { try {
const u = new URL(url); const u = new URL(url);
@@ -314,7 +321,7 @@ const Popup: FunctionComponent = () => {
className="ht-search-input" className="ht-search-input"
type="text" type="text"
autoFocus autoFocus
placeholder="Search Tabs" placeholder={t("ui_search_tabs")}
value={searchQuery} value={searchQuery}
style={{ style={{
width: "100%", width: "100%",
@@ -340,7 +347,7 @@ const Popup: FunctionComponent = () => {
</div> </div>
<hr style={{ opacity: "0.3", marginTop: "0px" }} /> <hr style={{ opacity: "0.3", marginTop: "0px" }} />
<div style={{ padding: "1em", fontWeight: "bold" }}> <div style={{ padding: "1em", fontWeight: "bold" }}>
Open Tabs ({tabs.length}) {t("ui_open_tabs", `${tabs.length}`)}
</div> </div>
<div <div
style={{ style={{