#641 - file parse

This commit is contained in:
Elio Struyf
2023-08-30 15:51:05 +02:00
parent 06f65c3627
commit 00b3e195a8
3 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -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)
+3 -2
View File
@@ -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({
+3 -2
View File
@@ -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;