From e97b618660094491013d9d4999ac4802429f3dc7 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Fri, 26 Jul 2024 23:53:31 +0300 Subject: Added translation support to Svelte --- src/pages/popup_src/App.svelte | 2 +- src/pages/popup_src/Buttons.svelte | 94 +++++++++++++++------------- src/pages/popup_src/components/Switch.svelte | 13 +++- 3 files changed, 63 insertions(+), 46 deletions(-) (limited to 'src/pages/popup_src') diff --git a/src/pages/popup_src/App.svelte b/src/pages/popup_src/App.svelte index cf88234d..df37d55d 100644 --- a/src/pages/popup_src/App.svelte +++ b/src/pages/popup_src/App.svelte @@ -1,5 +1,5 @@ -{#if redirect} - browser.runtime.sendMessage("redirectTab")}> - - - -{/if} - -{#if switchInstance} - browser.tabs.update({ url: await servicesHelper.switchInstance(url) })} - > - - - -{/if} +
+ {#if redirect} + browser.runtime.sendMessage("redirectTab")}> + + + + {/if} -{#if redirectToOriginal} - servicesHelper.copyRaw(url)}> - - - - browser.runtime.sendMessage("reverseTab")}> - - - -{/if} + {#if switchInstance} + browser.tabs.update({ url: await servicesHelper.switchInstance(url) })} + > + + + + {/if} -{#if redirect || switchInstance || redirectToOriginal} -
-{/if} + {#if redirectToOriginal} + servicesHelper.copyRaw(url)}> + + + + browser.runtime.sendMessage("reverseTab")}> + + + + {/if} -{#if currentService} - -
-{/if} + {#if redirect || switchInstance || redirectToOriginal} +
+ {/if} -{#each _options.popupServices as serviceKey} - {#if currentService !== serviceKey} - + {#if currentService} + +
{/if} -{/each} -
+ {#each _options.popupServices as serviceKey} + {#if currentService !== serviceKey} + + {/if} + {/each} + +
- window.open(browser.runtime.getURL("pages/options/index.html"), "_blank")}> - - - + window.open(browser.runtime.getURL("pages/options/index.html"), "_blank")}> + + + +
diff --git a/src/pages/popup_src/components/Switch.svelte b/src/pages/popup_src/components/Switch.svelte index f420caa1..e581e5f4 100644 --- a/src/pages/popup_src/components/Switch.svelte +++ b/src/pages/popup_src/components/Switch.svelte @@ -1,5 +1,5 @@