Engineering - adopt l10n for git-base/git/github extesions (#164566)

Co-authored-by: Tyler James Leonhardt <me@tylerleonhardt.com>
This commit is contained in:
Ladislau Szomoru
2022-10-28 11:27:08 +02:00
committed by GitHub
parent 8cc0246a78
commit f09c4124a2
21 changed files with 366 additions and 432 deletions

View File

@@ -3,15 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vscode-nls';
import { Command, Disposable, Event, EventEmitter, SourceControlActionButton, Uri, workspace } from 'vscode';
import { Command, Disposable, Event, EventEmitter, SourceControlActionButton, Uri, workspace, l10n } from 'vscode';
import { Branch, Status } from './api/git';
import { CommitCommandsCenter } from './postCommitCommands';
import { Repository, Operation } from './repository';
import { dispose } from './util';
const localize = nls.loadMessageBundle();
interface ActionButtonState {
readonly HEAD: Branch | undefined;
readonly isCommitInProgress: boolean;
@@ -106,8 +103,8 @@ export class ActionButtonCommand {
if (this.state.isRebaseInProgress) {
return {
command: 'git.commit',
title: localize('scm button continue title', "{0} Continue", '$(check)'),
tooltip: this.state.isCommitInProgress ? localize('scm button continuing tooltip', "Continuing Rebase...") : localize('scm button continue tooltip', "Continue Rebase"),
title: l10n.t('{0} Continue', '$(check)'),
tooltip: this.state.isCommitInProgress ? l10n.t('Continuing Rebase...') : l10n.t('Continue Rebase'),
arguments: [this.repository.sourceControl, '']
};
}
@@ -143,10 +140,10 @@ export class ActionButtonCommand {
return {
command: {
command: 'git.publish',
title: localize({ key: 'scm publish branch action button title', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }, "{0} Publish Branch", '$(cloud-upload)'),
title: l10n.t({ message: '{0} Publish Branch', args: ['$(cloud-upload)'], comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }),
tooltip: this.state.isSyncInProgress ?
localize({ key: 'scm button publish branch running', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }, "Publishing Branch...") :
localize({ key: 'scm button publish branch', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }, "Publish Branch"),
l10n.t({ message: 'Publishing Branch...', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }) :
l10n.t({ message: 'Publish Branch', comment: ['{Locked="Branch"}', 'Do not translate "Branch" as it is a git term'] }),
arguments: [this.repository.sourceControl],
},
enabled: !this.state.isSyncInProgress
@@ -170,11 +167,11 @@ export class ActionButtonCommand {
command: 'git.sync',
title: `${icon}${behind}${ahead}`,
tooltip: this.state.isSyncInProgress ?
localize('syncing changes', "Synchronizing Changes...")
l10n.t('Synchronizing Changes...')
: this.repository.syncTooltip,
arguments: [this.repository.sourceControl],
},
description: localize('scm button sync description', "{0} Sync Changes{1}{2}", icon, behind, ahead),
description: l10n.t('{0} Sync Changes{1}{2}', icon, behind, ahead),
enabled: !this.state.isSyncInProgress
};
}