#812 - Locale check for index.md files

This commit is contained in:
Elio Struyf
2024-06-06 10:13:45 +02:00
parent 4a1b37ba88
commit 9ce70fe722
+6
View File
@@ -33,6 +33,7 @@ import { getLocalizationFile } from '../utils/getLocalizationFile';
import * as l10n from '@vscode/l10n';
import { LocalizationKey } from '../localization';
import { joinUrl } from '../utils';
import { i18n } from './i18n';
export class Preview {
public static filePath: string | undefined = undefined;
@@ -298,6 +299,11 @@ export class Preview {
slug = Article.getSlug();
}
const locale = await i18n.getLocale(filePath);
if (locale && locale.path === slug) {
slug = '';
}
if (pathname) {
// Known placeholders
const dateFormat = Settings.get(SETTING_DATE_FORMAT) as string;