diff --git a/locales/en-US.yml b/locales/en-US.yml index 5df1a3f8fe..97abb02fe2 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -753,6 +753,10 @@ noCrawleDescription: "Ask search engines to not index your profile page, notes, lockedAccountInfo: "Unless you set your note visiblity to \"Followers only\", your notes will be visible to anyone, even if you require followers to be manually approved." alwaysMarkSensitive: "Mark as sensitive by default" loadRawImages: "Load original images instead of showing thumbnails" +searchEngine: "Search Engine For Search MFM" +searchEngineOther: "Other" +searchEngineCustomURIDescription: "The custom URI must be input in the format like \"https://www.google.com/search?q=\\{query}\" or \"https://www.google.com/search?q=%s\"." +searchEngineCusomURI: "Custom URI" disableShowingAnimatedImages: "Don't play animated images" highlightSensitiveMedia: "Highlight sensitive media" verificationEmailSent: "A verification email has been sent. Please follow the included link to complete verification." diff --git a/locales/generateDTS.js b/locales/generateDTS.js index 49807144ec..a175247445 100644 --- a/locales/generateDTS.js +++ b/locales/generateDTS.js @@ -6,7 +6,10 @@ import ts from 'typescript'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); -const parameterRegExp = /\{(\w+)\}/g; +// braces preceded by backslashes are literal, they don't represent +// parameters; they get cleaned up by `locales/index.js` before +// getting shipped to the browser +const parameterRegExp = /(? text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), ''); +// +// also, we remove the backslashes in front of open braces (the +// backslashes are only needed to tell `generateDTS.js` that the +// braces do not represent parameters) +const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), '').replaceAll(new RegExp(/\\+\{/,'g'), '{'); export function build() { const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(new URL(`${c}.yml`, import.meta.url), 'utf-8'))) || {}, a), {}); diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 000383e368..d3911819a1 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -752,6 +752,10 @@ noCrawleDescription: "外部の検索エンジンにあなたのユーザーペ lockedAccountInfo: "フォローを承認制にしても、ノートの公開範囲を「フォロワー」にしない限り、誰でもあなたのノートを見ることができます。" alwaysMarkSensitive: "デフォルトでメディアをセンシティブ設定にする" loadRawImages: "添付画像のサムネイルをオリジナル画質にする" +searchEngine: "検索MFMの検索エンジン" +searchEngineOther: "他" +searchEngineCustomURIDescription: "カスタム URI は、\"https://www.google.com/search?q=\\{query}\" や \"https://www.google.com/search?q=%s\" のような形式で入力する必要があります。" +searchEngineCusomURI: "カスタム URI" disableShowingAnimatedImages: "アニメーション画像を再生しない" highlightSensitiveMedia: "メディアがセンシティブであることを分かりやすく表示" verificationEmailSent: "確認のメールを送信しました。メールに記載されたリンクにアクセスして、設定を完了してください。" diff --git a/packages/frontend/src/components/MkGoogle.vue b/packages/frontend/src/components/MkGoogle.vue index c92a49d32a..d1809d1073 100644 --- a/packages/frontend/src/components/MkGoogle.vue +++ b/packages/frontend/src/components/MkGoogle.vue @@ -13,6 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 76081666d8..06f1f75ef0 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -63,6 +63,28 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.showGapBetweenNotesInTimeline }} {{ i18n.ts.loadRawImages }} Show instance ticker on replies + + + + + + + + + +
+ + + + +
+ @@ -273,11 +295,12 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/scripts/search-engine-map.ts b/packages/frontend/src/scripts/search-engine-map.ts new file mode 100644 index 0000000000..3fb06d135d --- /dev/null +++ b/packages/frontend/src/scripts/search-engine-map.ts @@ -0,0 +1,12 @@ +//store the URL and if its none of these its a custom one +export const searchEngineMap = { + //The first one is the default search engine + 'https://www.google.com/search?q={query}': 'Google', + 'https://duckduckgo.com/?q={query}': 'Duckduckgo', + 'https://www.bing.com/search?q={query}': 'Bing', + 'https://search.yahoo.com/search?p={query}': 'Yahoo', + 'https://www.ecosia.org/search?q={query}': 'Ecosia', + 'https://www.qwant.com/?q={query}': 'Qwant', + 'https://search.aol.com/aol/search?q={query}': 'AOL', + 'https://yandex.com/search?text={query}': 'Yandex', +}; diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 7f6377613e..0a4d853ca5 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -6,6 +6,7 @@ import { markRaw, ref } from 'vue'; import * as Misskey from 'misskey-js'; import { miLocalStorage } from './local-storage.js'; +import { searchEngineMap } from './scripts/search-engine-map.js'; import type { SoundType } from '@/scripts/sound.js'; import type { BuiltinTheme as ShikiBuiltinTheme } from 'shiki'; import { Storage } from '@/pizzax.js'; @@ -308,6 +309,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: false, }, + searchEngine: { + where: 'account', + default: Object.keys(searchEngineMap)[0], + }, noteDesign: { where: 'device', default: 'sharkey' as 'sharkey' | 'misskey',