Skip to content

Commit

Permalink
localize the toRelative calls
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-grant-work committed Jun 24, 2022
1 parent 2e7382f commit 2cae3db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/git/src/browser/blame/blame-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion packages/vsx-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class VSXExtensionsContribution extends AbstractViewContribution<VSXExten
}
const items: QuickPickItem[] = [];
compatibleExtensions.forEach(ext => {
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')})`;
}
Expand Down

0 comments on commit 2cae3db

Please sign in to comment.