Skip to content

Commit

Permalink
Use language instead of locale
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 committed Jan 9, 2023
1 parent 79c4f9b commit 98547d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import 'vs/css!./media/extensionEditor';
import { localize } from 'vs/nls';
import * as arrays from 'vs/base/common/arrays';
import { OS, locale } from 'vs/base/common/platform';
import { OS, language } from 'vs/base/common/platform';
import { Event, Emitter } from 'vs/base/common/event';
import { Cache, CacheResult } from 'vs/base/common/cache';
import { Action, IAction } from 'vs/base/common/actions';
Expand Down Expand Up @@ -943,19 +943,19 @@ export class ExtensionEditor extends EditorPane {
append(moreInfo,
$('.more-info-entry', undefined,
$('div', undefined, localize('published', "Published")),
$('div', undefined, new Date(gallery.releaseDate).toLocaleString(locale, { hourCycle: 'h23' }))
$('div', undefined, new Date(gallery.releaseDate).toLocaleString(language, { hourCycle: 'h23' }))
),
$('.more-info-entry', undefined,
$('div', undefined, localize('last released', "Last released")),
$('div', undefined, new Date(gallery.lastUpdated).toLocaleString(locale, { hourCycle: 'h23' }))
$('div', undefined, new Date(gallery.lastUpdated).toLocaleString(language, { hourCycle: 'h23' }))
)
);
}
if (extension.local && extension.local.installedTimestamp) {
append(moreInfo,
$('.more-info-entry', undefined,
$('div', undefined, localize('last updated', "Last updated")),
$('div', undefined, new Date(extension.local.installedTimestamp).toLocaleString(locale, { hourCycle: 'h23' }))
$('div', undefined, new Date(extension.local.installedTimestamp).toLocaleString(language, { hourCycle: 'h23' }))
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class InstallCountWidget extends ExtensionWidget {
}
}
else {
installLabel = installCount.toLocaleString(platform.locale);
installLabel = installCount.toLocaleString(platform.language);
}

return installLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { generateTokensCSSForColorMap } from 'vs/editor/common/languages/support
import { TokenizationRegistry } from 'vs/editor/common/languages';
import { DEFAULT_MARKDOWN_STYLES, renderMarkdownDocument } from 'vs/workbench/contrib/markdown/browser/markdownDocumentRenderer';
import { URI } from 'vs/base/common/uri';
import { locale } from 'vs/base/common/platform';
import { language } from 'vs/base/common/platform';
import { joinPath } from 'vs/base/common/resources';
import { assertIsDefined } from 'vs/base/common/types';
import { asWebviewUri } from 'vs/workbench/contrib/webview/common/webview';
Expand Down Expand Up @@ -229,9 +229,9 @@ export class GettingStartedDetailsRenderer {
} catch { }

try {
const localizedPath = path.with({ path: path.path.replace(/\.md$/, `.nls.${locale}.md`) });
const localizedPath = path.with({ path: path.path.replace(/\.md$/, `.nls.${language}.md`) });

const generalizedLocale = locale?.replace(/-.*$/, '');
const generalizedLocale = language?.replace(/-.*$/, '');
const generalizedLocalizedPath = path.with({ path: path.path.replace(/\.md$/, `.nls.${generalizedLocale}.md`) });

const fileExists = (file: URI) => this.fileService
Expand Down

0 comments on commit 98547d2

Please sign in to comment.