Translating Arduino-IDE using Theia's nls API (#545)

This commit is contained in:
Mark Sujew
2021-10-18 09:59:33 +02:00
committed by GitHub
parent 61262c23ac
commit 11b75bd610
76 changed files with 1445 additions and 499 deletions

View File

@@ -1,13 +1,22 @@
import * as React from 'react';
import { NotificationComponent } from './notification-component';
import { NotificationCenterComponent as TheiaNotificationCenterComponent } from '@theia/messages/lib/browser/notification-center-component';
import { nls } from '@theia/core/lib/browser/nls';
const PerfectScrollbar = require('react-perfect-scrollbar');
export class NotificationCenterComponent extends TheiaNotificationCenterComponent {
render(): React.ReactNode {
const empty = this.state.notifications.length === 0;
const title = empty ? 'NO NEW NOTIFICATIONS' : 'NOTIFICATIONS';
const title = empty
? nls.localize(
'vscode/notificationsCenter/notificationsEmpty',
'NO NEW NOTIFICATIONS'
)
: nls.localize(
'vscode/notificationsCenter/notifications',
'NOTIFICATIONS'
);
return (
<div
className={`theia-notifications-container theia-notification-center ${
@@ -20,12 +29,18 @@ export class NotificationCenterComponent extends TheiaNotificationCenterComponen
<ul className="theia-notification-actions">
<li
className="collapse"
title="Hide Notification Center"
title={nls.localize(
'vscode/notificationsStatus/hideNotifications',
'Hide Notification Center'
)}
onClick={this.onHide}
/>
<li
className="clear-all"
title="Clear All"
title={nls.localize(
'vscode/notificationsCommands/clearAllNotifications',
'Clear All'
)}
onClick={this.onClearAll}
/>
</ul>

View File

@@ -1,5 +1,6 @@
import * as React from 'react';
import { NotificationComponent as TheiaNotificationComponent } from '@theia/messages/lib/browser/notification-component';
import { nls } from '@theia/core/lib/browser/nls';
export class NotificationComponent extends TheiaNotificationComponent {
render(): React.ReactNode {
@@ -26,7 +27,11 @@ export class NotificationComponent extends TheiaNotificationComponent {
{expandable && (
<li
className={collapsed ? 'expand' : 'collapse'}
title={collapsed ? 'Expand' : 'Collapse'}
title={
collapsed
? nls.localize('theia/messages/expand', 'Expand')
: nls.localize('theia/messages/collapse', 'Collapse')
}
data-message-id={messageId}
onClick={this.onToggleExpansion}
/>
@@ -34,7 +39,7 @@ export class NotificationComponent extends TheiaNotificationComponent {
{!this.isProgress && (
<li
className="clear"
title="Clear"
title={nls.localize('vscode/abstractTree/clear', 'Clear')}
data-message-id={messageId}
onClick={this.onClear}
/>