From 03450e8a12afaff7819ab25029079fb3e4b65b95 Mon Sep 17 00:00:00 2001 From: Huakun Shen Date: Fri, 14 Feb 2025 00:28:38 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20add=20Portugu=C3=AAs=20to=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/desktop/project.inlang/settings.json | 2 +- apps/desktop/src/lib/constants.ts | 3 ++- apps/desktop/src/lib/stores/apps.ts | 13 ++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/desktop/project.inlang/settings.json b/apps/desktop/project.inlang/settings.json index fd2da1b..d96740a 100644 --- a/apps/desktop/project.inlang/settings.json +++ b/apps/desktop/project.inlang/settings.json @@ -1,7 +1,7 @@ { "$schema": "https://inlang.com/schema/project-settings", "sourceLanguageTag": "en", - "languageTags": ["en", "zh", "ru"], + "languageTags": ["en", "zh", "ru", "pt"], "modules": [ "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js", "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js", diff --git a/apps/desktop/src/lib/constants.ts b/apps/desktop/src/lib/constants.ts index 59b003a..9f228ec 100644 --- a/apps/desktop/src/lib/constants.ts +++ b/apps/desktop/src/lib/constants.ts @@ -23,5 +23,6 @@ export const IS_IN_TAURI = export const LanguageMap = { en: "English", zh: "中文", - ru: "Русский" + ru: "Русский", + pt: "Português" } diff --git a/apps/desktop/src/lib/stores/apps.ts b/apps/desktop/src/lib/stores/apps.ts index 9ea7565..b4b9f8b 100644 --- a/apps/desktop/src/lib/stores/apps.ts +++ b/apps/desktop/src/lib/stores/apps.ts @@ -2,6 +2,7 @@ import { getAllApps, refreshApplicationsList } from "@kksh/api/commands" import { AppInfo } from "@kksh/api/models" import { commandScore } from "@kksh/ui/utils" import * as fs from "@tauri-apps/plugin-fs" +import { platform } from "@tauri-apps/plugin-os" import { derived, get, writable } from "svelte/store" import { appState } from "./appState" @@ -13,10 +14,9 @@ export function createAppsLoaderStore() { get: () => get(store), init: async () => { await refreshApplicationsList() - const apps = await getAllApps() - // fs.writeTextFile("/Users/hk/Desktop/apps.json", JSON.stringify(apps)) - store.set( - apps.filter((app) => { + let apps = await getAllApps() + if (platform() === "macos") { + apps = apps.filter((app) => { return ( !app.app_desktop_path.includes("Parallels") && !app.app_desktop_path.startsWith("/Library/Application Support") && @@ -24,7 +24,10 @@ export function createAppsLoaderStore() { !app.app_desktop_path.startsWith("/System/Library/PrivateFrameworks") ) }) - ) + } + // console.log("filteredApps", apps) + // fs.writeTextFile("/Users/hk/Desktop/apps.json", JSON.stringify(apps)) + store.set(apps) } } }