Remove lingui (#1874)

* remove lingui

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* babelless

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* tweak ts-loader options

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* tweak renderer webpack config

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2020-12-29 14:53:34 +02:00
1 parent 050603a7b3
commit a03da3c572
163 files changed
+1140 -12003

No files matched your search

@@ -4,8 +4,6 @@ import React from "react";
import { remote, FileFilter } from "electron";
import { observable } from "mobx";
import { observer } from "mobx-react";
import { t, Trans } from "@lingui/macro";
import { _i18n } from "../../i18n";
import { Dialog, DialogProps } from "../dialog";
import { Wizard, WizardStep } from "../wizard";
import { Input } from "../input";
@@ -66,8 +64,8 @@ export class AddHelmRepoDialog extends React.Component<Props> {
const { canceled, filePaths } = await dialog.showOpenDialog(BrowserWindow.getFocusedWindow(), {
defaultPath: this.getFilePath(type),
properties: ["openFile", "showHiddenFiles"],
message: _i18n._(t`Select file`),
buttonLabel: _i18n._(t`Use file`),
message: `Select file`,
buttonLabel: `Use file`,
filters: [
fileFilter,
{ name: "Any", extensions: ["*"]}
@@ -82,11 +80,11 @@ export class AddHelmRepoDialog extends React.Component<Props> {
async addCustomRepo() {
try {
await repoManager.addСustomRepo(this.helmRepo);
Notifications.ok(<Trans>Helm repository <b>{this.helmRepo.name}</b> has added</Trans>);
Notifications.ok(<>Helm repository <b>{this.helmRepo.name}</b> has added</>);
this.props.onAddRepo();
this.close();
} catch (err) {
Notifications.error(<Trans>Adding helm branch <b>{this.helmRepo.name}</b> has failed: {String(err)}</Trans>);
Notifications.error(<>Adding helm branch <b>{this.helmRepo.name}</b> has failed: {String(err)}</>);
}
}
@@ -103,7 +101,7 @@ export class AddHelmRepoDialog extends React.Component<Props> {
<Icon
material="folder"
onClick={() => this.selectFileDialog(fileType, {name: placeholder, extensions: fileExtensions})}
tooltip={<Trans>Browse</Trans>}
tooltip="Browse"
/>
</div>);
}
@@ -111,23 +109,23 @@ export class AddHelmRepoDialog extends React.Component<Props> {
renderOptions() {
return (
<>
<SubTitle title={<Trans>Security settings</Trans>} />
<SubTitle title="Security settings" />
<Checkbox
label={_i18n._(t`Skip TLS certificate checks for the repository`)}
label={`Skip TLS certificate checks for the repository`}
value={this.helmRepo.insecureSkipTlsVerify}
onChange={v => this.helmRepo.insecureSkipTlsVerify = v}
/>
{this.renderFileInput(_i18n._(t`Key file`), FileType.KeyFile, AddHelmRepoDialog.keyExtensions)}
{this.renderFileInput(_i18n._(t`Ca file`), FileType.CaFile, AddHelmRepoDialog.certExtensions)}
{this.renderFileInput(_i18n._(t`Cerificate file`), FileType.CertFile, AddHelmRepoDialog.certExtensions)}
<SubTitle title={<Trans>Chart Repository Credentials</Trans>} />
{this.renderFileInput(`Key file`, FileType.KeyFile, AddHelmRepoDialog.keyExtensions)}
{this.renderFileInput(`Ca file`, FileType.CaFile, AddHelmRepoDialog.certExtensions)}
{this.renderFileInput(`Cerificate file`, FileType.CertFile, AddHelmRepoDialog.certExtensions)}
<SubTitle title="Chart Repository Credentials" />
<Input
placeholder={_i18n._(t`Username`)}
placeholder={`Username`}
value={this.helmRepo.username} onChange= {v => this.helmRepo.username = v}
/>
<Input
type="password"
placeholder={_i18n._(t`Password`)}
placeholder={`Password`}
value={this.helmRepo.password} onChange={v => this.helmRepo.password = v}
/>
</>);
@@ -136,7 +134,7 @@ export class AddHelmRepoDialog extends React.Component<Props> {
render() {
const { ...dialogProps } = this.props;
const header = <h5><Trans>Add custom Helm Repo</Trans></h5>;
const header = <h5>Add custom Helm Repo</h5>;
return (
<Dialog
@@ -146,25 +144,25 @@ export class AddHelmRepoDialog extends React.Component<Props> {
close={this.close}
>
<Wizard header={header} done={this.close}>
<WizardStep contentClass="flow column" nextLabel={<Trans>Add</Trans>} next={()=>{this.addCustomRepo();}}>
<WizardStep contentClass="flow column" nextLabel="Add" next={()=>{this.addCustomRepo();}}>
<div className="flex column gaps">
<Input
autoFocus required
placeholder={_i18n._(t`Helm repo name`)}
placeholder={`Helm repo name`}
validators={systemName}
value={this.helmRepo.name} onChange={v => this.helmRepo.name = v}
/>
<Input
required
placeholder={_i18n._(t`URL`)}
placeholder={`URL`}
validators={isUrl}
value={this.helmRepo.url} onChange={v => this.helmRepo.url = v}
/>
<Button plain className="accordion" onClick={() => this.showOptions = !this.showOptions} >
<Trans>More</Trans>
More
<Icon
small
tooltip={_i18n._(t`More`)}
tooltip={`More`}
material={this.showOptions ? "remove" : "add"}
/>
</Button>
@@ -1,5 +1,4 @@
import React, { useState } from "react";
import { Trans } from "@lingui/macro";
import { Checkbox } from "../checkbox";
import { Input, InputValidators } from "../input";
import { SubTitle } from "../layout/sub-title";
@@ -25,18 +24,18 @@ export const KubectlBinaries = observer(({ preferences }: { preferences: UserPre
return (
<>
<h2><Trans>Kubectl Binary</Trans></h2>
<h2>Kubectl Binary</h2>
<Checkbox
label={<Trans>Download kubectl binaries</Trans>}
label="Download kubectl binaries"
value={preferences.downloadKubectlBinaries}
onChange={downloadKubectlBinaries => preferences.downloadKubectlBinaries = downloadKubectlBinaries}
/>
<small className="hint">
<Trans>Download kubectl binaries matching to Kubernetes cluster version.</Trans>
Download kubectl binaries matching to Kubernetes cluster version.
</small>
<SubTitle title="Download mirror" />
<Select
placeholder={<Trans>Download mirror for kubectl</Trans>}
placeholder="Download mirror for kubectl"
options={downloadMirrorOptions}
value={preferences.downloadMirror}
onChange={({ value }: SelectOption) => preferences.downloadMirror = value}
@@ -66,7 +65,7 @@ export const KubectlBinaries = observer(({ preferences }: { preferences: UserPre
disabled={preferences.downloadKubectlBinaries}
/>
<small className="hint">
<Trans>The path to the kubectl binary on the system.</Trans>
The path to the kubectl binary on the system.
</small>
</>
);
@@ -3,8 +3,6 @@ import "./preferences.scss";
import React from "react";
import { observer } from "mobx-react";
import { action, computed, observable } from "mobx";
import { t, Trans } from "@lingui/macro";
import { _i18n } from "../../i18n";
import { Icon } from "../icon";
import { Select, SelectOption } from "../select";
import { userStore } from "../../../common/user-store";
@@ -69,7 +67,7 @@ export class Preferences extends React.Component {
await repoManager.addRepo(repo);
this.helmAddedRepos.set(repo.name, repo);
} catch (err) {
Notifications.error(<Trans>Adding helm branch <b>{repo.name}</b> has failed: {String(err)}</Trans>);
Notifications.error(<>Adding helm branch <b>{repo.name}</b> has failed: {String(err)}</>);
}
}
@@ -79,7 +77,7 @@ export class Preferences extends React.Component {
this.helmAddedRepos.delete(repo.name);
} catch (err) {
Notifications.error(
<Trans>Removing helm branch <b>{repo.name}</b> has failed: {String(err)}</Trans>
<>Removing helm branch <b>{repo.name}</b> has failed: {String(err)}</>
);
}
}
@@ -88,7 +86,7 @@ export class Preferences extends React.Component {
const isAdded = this.helmAddedRepos.has(repo.name);
if (isAdded) {
Notifications.ok(<Trans>Helm branch <b>{repo.name}</b> already in use</Trans>);
Notifications.ok(<>Helm branch <b>{repo.name}</b> already in use</>);
return;
}
@@ -110,35 +108,35 @@ export class Preferences extends React.Component {
render() {
const { preferences } = userStore;
const header = <h2><Trans>Preferences</Trans></h2>;
const header = <h2>Preferences</h2>;
return (
<PageLayout showOnTop className="Preferences" header={header}>
<h2><Trans>Color Theme</Trans></h2>
<h2>Color Theme</h2>
<Select
options={this.themeOptions}
value={preferences.colorTheme}
onChange={({ value }: SelectOption) => preferences.colorTheme = value}
/>
<h2><Trans>HTTP Proxy</Trans></h2>
<h2>HTTP Proxy</h2>
<Input
theme="round-black"
placeholder={_i18n._(t`Type HTTP proxy url (example: http://proxy.acme.org:8080)`)}
placeholder={`Type HTTP proxy url (example: http://proxy.acme.org:8080)`}
value={this.httpProxy}
onChange={v => this.httpProxy = v}
onBlur={() => preferences.httpsProxy = this.httpProxy}
/>
<small className="hint">
<Trans>Proxy is used only for non-cluster communication.</Trans>
Proxy is used only for non-cluster communication.
</small>
<KubectlBinaries preferences={preferences}/>
<h2><Trans>Helm</Trans></h2>
<h2>Helm</h2>
<div className="flex gaps">
<Select id="HelmRepoSelect"
placeholder={<Trans>Repositories</Trans>}
placeholder="Repositories"
isLoading={this.helmLoading}
isDisabled={this.helmLoading}
options={this.helmOptions}
@@ -149,7 +147,7 @@ export class Preferences extends React.Component {
/>
<Button
primary
label={<Trans>Add Custom Helm Repo</Trans>}
label="Add Custom Helm Repo"
onClick={AddHelmRepoDialog.open}
/>
</div>
@@ -164,7 +162,7 @@ export class Preferences extends React.Component {
<Icon
material="delete"
onClick={() => this.removeRepo(repo)}
tooltip={<Trans>Remove</Trans>}
tooltip="Remove"
/>
<Tooltip targetId={tooltipId} formatters={{ narrow: true }}>
{repo.url}
@@ -174,23 +172,23 @@ export class Preferences extends React.Component {
})}
</div>
<h2><Trans>Auto start-up</Trans></h2>
<h2>Auto start-up</h2>
<Checkbox
label={<Trans>Automatically start Lens on login</Trans>}
label="Automatically start Lens on login"
value={preferences.openAtLogin}
onChange={v => preferences.openAtLogin = v}
/>
<h2><Trans>Certificate Trust</Trans></h2>
<h2>Certificate Trust</h2>
<Checkbox
label={<Trans>Allow untrusted Certificate Authorities</Trans>}
label="Allow untrusted Certificate Authorities"
value={preferences.allowUntrustedCAs}
onChange={v => preferences.allowUntrustedCAs = v}
/>
<small className="hint">
<Trans>This will make Lens to trust ANY certificate authority without any validations.</Trans>{" "}
<Trans>Needed with some corporate proxies that do certificate re-writing.</Trans>{" "}
<Trans>Does not affect cluster communications!</Trans>
This will make Lens to trust ANY certificate authority without any validations.{" "}
Needed with some corporate proxies that do certificate re-writing.{" "}
Does not affect cluster communications!
</small>
<div className="extensions flex column gaps">