diff --git a/packages/core/src/browser/browser-clipboard-service.ts b/packages/core/src/browser/browser-clipboard-service.ts index 687bac9bf96cf..924309c535d0a 100644 --- a/packages/core/src/browser/browser-clipboard-service.ts +++ b/packages/core/src/browser/browser-clipboard-service.ts @@ -19,6 +19,7 @@ import { isFirefox } from './browser'; import { ClipboardService } from './clipboard-service'; import { ILogger } from '../common/logger'; import { MessageService } from '../common/message-service'; +import { nls } from '../common/nls'; export interface NavigatorClipboard { readText(): Promise; @@ -52,16 +53,21 @@ export class BrowserClipboardService implements ClipboardService { } catch (e2) { this.logger.error('Failed reading clipboard content.', e2); if (isFirefox) { - this.messageService.warn(`Clipboard API is not available. - It can be enabled by 'dom.events.testing.asyncClipboard' preference on 'about:config' page. Then reload Theia. - Note, it will allow FireFox getting full access to the system clipboard.`); + this.messageService.warn(nls.localize( + 'theia/navigator/clipboardWarnFirefox', + // eslint-disable-next-line max-len + "Clipboard API is not available. It can be enabled by '{0}' preference on '{1}' page. Then reload Theia. Note, it will allow FireFox getting full access to the system clipboard.", 'dom.events.testing.asyncClipboard', 'about:config' + )); } return ''; } } if (permission.state === 'denied') { // most likely, the user intentionally denied the access - this.messageService.warn("Access to the clipboard is denied. Check your browser's permission."); + this.messageService.warn(nls.localize( + 'theia/navigator/clipboardWarn', + "Access to the clipboard is denied. Check your browser's permission." + )); return ''; } return this.getClipboardAPI().readText(); @@ -80,16 +86,21 @@ export class BrowserClipboardService implements ClipboardService { } catch (e2) { this.logger.error('Failed writing to the clipboard.', e2); if (isFirefox) { - this.messageService.warn(`Clipboard API is not available. - It can be enabled by 'dom.events.testing.asyncClipboard' preference on 'about:config' page. Then reload Theia. - Note, it will allow FireFox getting full access to the system clipboard.`); + this.messageService.warn(nls.localize( + 'theia/core/navigator/clipboardWarnFirefox', + // eslint-disable-next-line max-len + "Clipboard API is not available. It can be enabled by '{0}' preference on '{1}' page. Then reload Theia. Note, it will allow FireFox getting full access to the system clipboard.", 'dom.events.testing.asyncClipboard', 'about:config' + )); } return; } } if (permission.state === 'denied') { // most likely, the user intentionally denied the access - this.messageService.warn("Access to the clipboard is denied. Check your browser's permission."); + this.messageService.warn(nls.localize( + 'theia/core/navigator/clipboardWarn', + "Access to the clipboard is denied. Check your browser's permission." + )); return; } return this.getClipboardAPI().writeText(value); diff --git a/packages/git/src/browser/git-scm-provider.ts b/packages/git/src/browser/git-scm-provider.ts index 9fa021b3f12d8..42ca2838536e9 100644 --- a/packages/git/src/browser/git-scm-provider.ts +++ b/packages/git/src/browser/git-scm-provider.ts @@ -241,13 +241,21 @@ export class GitScmProvider implements ScmProvider { return DiffUris.encode( fromFileUri.withScheme(GIT_RESOURCE_SCHEME).withQuery('HEAD'), changeUri.withScheme(GIT_RESOURCE_SCHEME), - this.labelProvider.getName(changeUri) + ' (Index)'); + nls.localize( + 'theia/git/tabTitleIndex', + '{0} (Index)', + this.labelProvider.getName(changeUri) + )); } if (this.stagedChanges.find(c => c.uri === change.uri)) { return DiffUris.encode( fromFileUri.withScheme(GIT_RESOURCE_SCHEME), changeUri, - this.labelProvider.getName(changeUri) + ' (Working tree)'); + nls.localize( + 'theia/git/tabTitleWorkingTree', + '{0} (Working tree)', + this.labelProvider.getName(changeUri) + )); } if (this.mergeChanges.find(c => c.uri === change.uri)) { return changeUri; @@ -255,7 +263,11 @@ export class GitScmProvider implements ScmProvider { return DiffUris.encode( fromFileUri.withScheme(GIT_RESOURCE_SCHEME).withQuery('HEAD'), changeUri, - this.labelProvider.getName(changeUri) + ' (Working tree)'); + nls.localize( + 'theia/git/tabTitleWorkingTree', + '{0} (Working tree)', + this.labelProvider.getName(changeUri) + )); } if (change.staged) { return changeUri.withScheme(GIT_RESOURCE_SCHEME); @@ -264,7 +276,11 @@ export class GitScmProvider implements ScmProvider { return DiffUris.encode( changeUri.withScheme(GIT_RESOURCE_SCHEME), changeUri, - this.labelProvider.getName(changeUri) + ' (Working tree)'); + nls.localize( + 'theia/git/tabTitleWorkingTree', + '{0} (Working tree)', + this.labelProvider.getName(changeUri) + )); } return changeUri; } diff --git a/packages/scm-extra/src/browser/history/scm-history-widget.tsx b/packages/scm-extra/src/browser/history/scm-history-widget.tsx index 6c548550d6e25..6eb4f110e49cf 100644 --- a/packages/scm-extra/src/browser/history/scm-history-widget.tsx +++ b/packages/scm-extra/src/browser/history/scm-history-widget.tsx @@ -307,12 +307,14 @@ export class ScmHistoryWidget extends ScmNavigableListWidget const repo = this.scmService.findRepository(new URI(this.options.uri)); const repoName = repo ? `${this.labelProvider.getName(new URI(repo.provider.rootUri))}` : ''; - const relPathAndRepo = [relPath, repoName].filter(Boolean).join(' in '); - path = ` for ${relPathAndRepo}`; + const relPathAndRepo = [relPath, repoName].filter(Boolean).join( + ` ${nls.localize('theia/git/prepositionIn', 'in')} ` + ); + path = `${relPathAndRepo}`; } content = + header={nls.localize('theia/git/noHistoryForError', 'There is no history available for {0}', `${path}`)}> {reason} ; break;