Update localization messages for Chinese, English, and Japanese languages

This commit is contained in:
n4ze3m
2024-04-14 18:16:47 +05:30
parent 36c1cae5fb
commit 9eaa0c9d66
10 changed files with 194 additions and 32 deletions

View File

@@ -1,4 +1,6 @@
import { getOllamaURL, isOllamaRunning } from "../services/ollama"
import { Storage } from "@plasmohq/storage"
const progressHuman = (completed: number, total: number) => {
return ((completed / total) * 100).toFixed(0) + "%"
}
@@ -75,6 +77,8 @@ const streamDownload = async (url: string, model: string) => {
}
export default defineBackground({
main() {
const storage = new Storage()
chrome.runtime.onMessage.addListener(async (message) => {
if (message.type === "sidepanel") {
chrome.tabs.query(
@@ -139,8 +143,8 @@ export default defineBackground({
{ active: true, currentWindow: true },
async (tabs) => {
const tab = tabs[0]
await chrome.sidePanel.open({
windowId: tab.windowId!
chrome.sidePanel.open({
tabId: tab.id!
})
}
)