diff --git a/README-zh.md b/README-zh.md index dbe20c3..efb5382 100644 --- a/README-zh.md +++ b/README-zh.md @@ -5,6 +5,9 @@ 所以我在[原作者](https://github.com/EasyChris/obsidian-to-notion)的基础之上,增加了匹配[NotionNext](https://github.com/tangly1024/NotionNext)模板的功能。这样可以直接在Obsidian编辑,整理好之后一键发布。 ## 更新说明 +### 1.1.1 +- 修复了在日语系统下,无法显示设置按钮的错误。 +- 增加日语翻译。 ### 1.1.0 - 修复设置中自定义标题的显示问题。 - 增加了标签同步的控制按钮。以减少空标签集造成的上传失败。 diff --git a/README.md b/README.md index 1895892..71e3aba 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ Thus, based on the [original author's work](https://github.com/EasyChris/obsidia **Now, support both NotionNext and General databases.** ## Update +### 1.1.1 +- Fix the setting display bug in Japanese. +- Add Japanese translation. ### 1.1.0 - Fix the custom name setting tab display bug. diff --git a/manifest.json b/manifest.json index eb0e22b..cfb2057 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "share-to-notionnext", "name": "Share to NotionNext", - "version": "1.1.0", + "version": "1.1.1", "minAppVersion": "0.0.1", "description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.", "author": "EasyChris, jxpeng98", diff --git a/package.json b/package.json index 59d124d..9f28b0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "share-to-notionnext", - "version": "1.1.0", + "version": "1.1.1", "type": "module", "description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.", "main": "main.js", diff --git a/src/lang/I18n.ts b/src/lang/I18n.ts index db95e0b..c87d69e 100644 --- a/src/lang/I18n.ts +++ b/src/lang/I18n.ts @@ -1,15 +1,17 @@ -import {en} from "./en"; -import {zh} from "./zh"; +import {en} from "./locale/en"; +import {zh} from "./locale/zh"; +import {ja} from "./locale/ja"; -export const I18n: { [key: string]: any } = { +export const I18n: {[key: string]:any} = { en, zh, + ja, }; -export const I18nConfig = (lang: any): any => { +export const I18nConfig = (lang: string): any => { return I18n[lang]; }; -export const i18nConfig = I18nConfig( - window.localStorage.getItem("language") || "en", -); // Export i18nConfig +const storedLanguage = window.localStorage.getItem("language"); + +export const i18nConfig = I18n[storedLanguage || window.navigator.language.split('-')[0] || "en"]; diff --git a/src/lang/en.ts b/src/lang/locale/en.ts similarity index 100% rename from src/lang/en.ts rename to src/lang/locale/en.ts diff --git a/src/lang/locale/ja.ts b/src/lang/locale/ja.ts new file mode 100644 index 0000000..875e543 --- /dev/null +++ b/src/lang/locale/ja.ts @@ -0,0 +1,46 @@ +export const ja = { + ribbonIcon: "NotionNextで共有", + GeneralSetting: "一般設定", + CommandID: "share-to-notionnext", + CommandName: "NotionNextデータベースに共有", + CommandIDGeneral: "share-to-notion", + CommandNameGeneral: "一般的なNotionデータベースに共有", + NotionNextButton: "NotionNext同期", + NotionNextButtonDesc: "このオプションを開くと、NotionNext同期コマンドがコマンドパレットに表示されます(デフォルト:ON)", + NotionNextSettingHeader: "NotionNextデータベース設定", + NotionAPI: "Notion API トークン", + NotionAPIDesc: "https://www.notion.so/my-integrations から生成してください", + NotionAPIText: "Notion API トークンを入力", + DatabaseID: "データベースID", + DatabaseIDText: "データベースIDを入力", + BannerUrl: "バナーのURL(任意)", + BannerUrlDesc: "デフォルトは空白です。バナーを表示したい場合は、URLを入力してください(例:https://minioapi.pjx.ac.cn/img1/2023/11/b7b40a0724e93b7d7ab494bb3b8a2da8.png)", + BannerUrlText: "バナーのURLを入力", + NotionUser: "Notion ID(ユーザー名、任意)", + NotionUserDesc: "共有リンクから取得(例:https://username.notion.site)。Notion IDは[username]です", + NotionUserText: "Notion IDを入力", + NotionGeneralSettingHeader: "一般的なNotionデータベース設定", + NotionGeneralButton: "一般的なNotion同期", + NotionGeneralButtonDesc: "このオプションを開くと、一般的なNotionデータベース同期コマンドがコマンドパレットに表示されます(デフォルト:ON)", + NotionTagButton: "Notionタグ同期", + NotionTagButtonDesc: "タグを一般的なNotionデータベースに同期(デフォルト:ON)", + NotionCustomTitle: "タイトルのカスタマイズ", + NotionCustomTitleDesc: "Notionデータベースの列名を変更(デフォルト:OFF)", + NotionCustomTitleName: "希望のタイトル名", + NotionCustomTitleNameDesc: "Notionデータベースの最初の列のための希望のタイトル名を入力(デフォルト:title)", + NotionCustomTitleText: "名前を入力", + NotYetFinish: "未完了。この機能は次のバージョンで利用可能になります", + PlaceHolder: "データベース名を入力", + "notion-logo": "NotionNextで共有", + "sync-success": "NotionNextへの同期に成功:\n", + "sync-fail": "NotionNextへの同期に失敗:\n", + "open-notion": "同期が必要なファイルを開いてください", + "config-secrets-notion-api": "設定タブでNotion APIを設定してください", + "config-secrets-database-id": "設定タブでデータベースIDを設定してください", + "set-tags-fail": "タグの設定に失敗。ファイルのfrontmatterを確認するか、設定タブでタグのスイッチをオフにしてください", + NNonMissing: "設定に 'NNon' プロパティがありません。設定してください", + "set-api-id": "設定タブでNotion APIおよびデータベースIDを設定してください", + NotionCustomSettingHeader: "Notionカスタムデータベース設定", + NotionCustomButton: "Notionカスタマイズコマンドの切り替え", + NotionCustomButtonDesc: "このオプションを開くと、Notionカスタムデータベース同期コマンドがコマンドパレットに表示されます", +}; diff --git a/src/lang/zh.ts b/src/lang/locale/zh.ts similarity index 100% rename from src/lang/zh.ts rename to src/lang/locale/zh.ts