From 2cae3db2c87843e64e2ebaa90a8a97e6375fabc8 Mon Sep 17 00:00:00 2001 From: Colin Grant Date: Fri, 24 Jun 2022 10:53:40 -0600 Subject: [PATCH] localize the toRelative calls --- packages/git/src/browser/blame/blame-decorator.ts | 6 ++++-- packages/vsx-registry/package.json | 1 - .../vsx-registry/src/browser/vsx-extensions-contribution.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/git/src/browser/blame/blame-decorator.ts b/packages/git/src/browser/blame/blame-decorator.ts index a34e84424fe00..40b1502127aba 100644 --- a/packages/git/src/browser/blame/blame-decorator.ts +++ b/packages/git/src/browser/blame/blame-decorator.ts @@ -17,7 +17,7 @@ import { inject, injectable } from '@theia/core/shared/inversify'; import { EditorManager, TextEditor, EditorDecoration, EditorDecorationOptions, Range, Position, EditorDecorationStyle } from '@theia/editor/lib/browser'; import { GitFileBlame } from '../../common'; -import { Disposable, DisposableCollection } from '@theia/core'; +import { Disposable, DisposableCollection, nls } from '@theia/core'; import { DateTime } from 'luxon'; import URI from '@theia/core/lib/common/uri'; import { DecorationStyle } from '@theia/core/lib/browser'; @@ -140,7 +140,9 @@ export class BlameDecorator implements monaco.languages.HoverProvider { }, this.blameDecorationsStyleSheet)); new EditorDecorationStyle('.git-' + short + '::after', style => { Object.assign(style, BlameDecorator.defaultGutterAfterStyles); - style.content = (this.now.diff(commitTime, 'seconds').toObject().seconds ?? 0) < 60 ? "'a few seconds ago'" : `'${commitTime.toRelative()}'`; + style.content = (this.now.diff(commitTime, 'seconds').toObject().seconds ?? 0) < 60 + ? `'${nls.localize('theia/git/aFewSecondsAgo', 'a few seconds ago')}'` + : `'${commitTime.toRelative({ locale: nls.locale })}'`; }, this.blameDecorationsStyleSheet); } const commitLines = blame.lines; diff --git a/packages/vsx-registry/package.json b/packages/vsx-registry/package.json index caa83e049a145..251a67dc799b1 100644 --- a/packages/vsx-registry/package.json +++ b/packages/vsx-registry/package.json @@ -10,7 +10,6 @@ "@theia/plugin-ext-vscode": "1.26.0", "@theia/preferences": "1.26.0", "@theia/workspace": "1.26.0", - "@types/showdown": "^1.7.1", "luxon": "^2.4.0", "p-debounce": "^2.1.0", "semver": "^5.4.1", diff --git a/packages/vsx-registry/src/browser/vsx-extensions-contribution.ts b/packages/vsx-registry/src/browser/vsx-extensions-contribution.ts index 30e2509fa2b1f..5ea18192b1610 100644 --- a/packages/vsx-registry/src/browser/vsx-extensions-contribution.ts +++ b/packages/vsx-registry/src/browser/vsx-extensions-contribution.ts @@ -215,7 +215,7 @@ export class VSXExtensionsContribution extends AbstractViewContribution { - let publishedDate = DateTime.fromISO(ext.timestamp).toRelative() ?? ''; + let publishedDate = DateTime.fromISO(ext.timestamp).toRelative({ locale: nls.locale }) ?? ''; if (currentVersion === ext.version) { publishedDate += ` (${nls.localizeByDefault('Current')})`; }