diff --git a/CHANGELOG.md b/CHANGELOG.md index 20a44a9f..fa6fba55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,9 @@ - [#633](https://github.com/estruyf/vscode-front-matter/issues/633): Fix custom taxonomy used as single value - [#634](https://github.com/estruyf/vscode-front-matter/issues/634): Fix public folder processing in case of Hexo - [#635](https://github.com/estruyf/vscode-front-matter/issues/635): Fix UI themes make some links hard to discover or see -- [#636](https://github.com/estruyf/vscode-front-matter/issues/636): Fix UI themes make some links hard to discover or see +- [#636](https://github.com/estruyf/vscode-front-matter/issues/636): Fix media browser lightbox background color +- [#641](https://github.com/estruyf/vscode-front-matter/issues/641): Fix file parsing of the localization file + ## [9.0.0] - 2023-08-21 - [Release notes](https://beta.frontmatter.codes/updates/v9.0.0) diff --git a/src/extension.ts b/src/extension.ts index a1ae8b92..c828c50c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -4,7 +4,7 @@ import { COMMAND_NAME, TelemetryEvent } from './constants'; import { MarkdownFoldingProvider } from './providers/MarkdownFoldingProvider'; import { TagType } from './panelWebView/TagType'; import { PanelProvider } from './panelWebView/PanelProvider'; -import { DashboardSettings, debounceCallback, Logger, Settings as SettingsHelper } from './helpers'; +import { DashboardSettings, debounceCallback, Logger, parseWinPath, Settings as SettingsHelper } from './helpers'; import ContentProvider from './providers/ContentProvider'; import { PagesListener } from './listeners/dashboard'; import { DataListener, SettingsListener } from './listeners/panel'; @@ -30,6 +30,7 @@ import { StatusListener, Chatbot } from './commands'; +import { join } from 'path'; let frontMatterStatusBar: vscode.StatusBarItem; let statusDebouncer: { (fnc: any, time: number): void }; @@ -45,7 +46,7 @@ export async function activate(context: vscode.ExtensionContext) { // Make sure the EN language file is loaded if (!vscode.l10n.uri) { l10n.config({ - fsPath: vscode.Uri.parse(`${extensionPath}/l10n/bundle.l10n.json`).fsPath + fsPath: vscode.Uri.file(join(parseWinPath(extensionPath), `/l10n/bundle.l10n.json`)).fsPath }); } else { l10n.config({ diff --git a/src/utils/getLocalizationFile.ts b/src/utils/getLocalizationFile.ts index 29c8019f..48406ced 100644 --- a/src/utils/getLocalizationFile.ts +++ b/src/utils/getLocalizationFile.ts @@ -1,12 +1,13 @@ import { Uri, l10n } from 'vscode'; -import { Extension, Logger } from '../helpers'; +import { Extension, Logger, parseWinPath } from '../helpers'; import { readFileAsync } from './readFileAsync'; +import { join } from 'path'; export const getLocalizationFile = async () => { try { const localeFilePath = l10n.uri?.fsPath || - Uri.parse(`${Extension.getInstance().extensionPath}/l10n/bundle.l10n.json`).fsPath; + Uri.file(join(parseWinPath(Extension.getInstance().extensionPath.fsPath), `/l10n/bundle.l10n.json`)).fsPath; const fileContents = await readFileAsync(localeFilePath, 'utf-8'); return fileContents;