mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
1 parent
050603a7b3
commit
a03da3c572
163 files changed
+1140
-12003
No files matched your search
@@ -4,7 +4,6 @@ import groupBy from "lodash/groupBy";
|
||||
import React, { ReactNode } from "react";
|
||||
import { computed, observable, reaction, toJS, when } from "mobx";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { Plural, Trans } from "@lingui/macro";
|
||||
import { ConfirmDialog, ConfirmDialogParams } from "../confirm-dialog";
|
||||
import { TableSortCallback, Table, TableCell, TableCellProps, TableHead, TableProps, TableRow, TableRowProps } from "../table";
|
||||
import { autobind, createStorage, cssNames, IClassName, isReactNode, noop, prevDefault, stopPropagation } from "../../utils";
|
||||
@@ -280,18 +279,13 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
|
||||
const dialogCustomProps = customizeRemoveDialog ? customizeRemoveDialog(selectedItems) : {};
|
||||
const selectedCount = selectedItems.length;
|
||||
const tailCount = selectedCount > visibleMaxNamesCount ? selectedCount - visibleMaxNamesCount : 0;
|
||||
const tail = tailCount > 0 ? <Trans>and <b>{tailCount}</b> more</Trans> : null;
|
||||
const tail = tailCount > 0 ? "and <b>{tailCount}</b> more" : null;
|
||||
const message = selectedCount <= 1 ? <p>Remove item <b>{selectedNames}</b>?</p> : <p>Remove <b>{selectedCount}</b> items <b>{selectedNames}</b> {tail}?</p>;
|
||||
|
||||
ConfirmDialog.open({
|
||||
ok: removeSelectedItems,
|
||||
labelOk: <Trans>Remove</Trans>,
|
||||
message: (
|
||||
<Plural
|
||||
value={selectedCount}
|
||||
one={<p>Remove item <b>{selectedNames}</b>?</p>}
|
||||
other={<p>Remove <b>{selectedCount}</b> items <b>{selectedNames}</b> {tail}?</p>}
|
||||
/>
|
||||
),
|
||||
labelOk: "Remove",
|
||||
message,
|
||||
...dialogCustomProps,
|
||||
});
|
||||
}
|
||||
@@ -316,10 +310,10 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
|
||||
if (isFiltered) {
|
||||
return (
|
||||
<NoItems>
|
||||
<Trans>No items found.</Trans>
|
||||
No items found.
|
||||
<p>
|
||||
<a onClick={() => pageFilters.reset()} className="contrast">
|
||||
<Trans>Reset filters?</Trans>
|
||||
Reset filters?
|
||||
</a>
|
||||
</p>
|
||||
</NoItems>
|
||||
@@ -354,19 +348,11 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
|
||||
const toggleFilters = () => userSettings.showAppliedFilters = !userSettings.showAppliedFilters;
|
||||
|
||||
return (
|
||||
<Trans>
|
||||
<a onClick={toggleFilters}>Filtered</a>: {itemsCount} / {allItemsCount}
|
||||
</Trans>
|
||||
<><a onClick={toggleFilters}>Filtered</a>: {itemsCount} / {allItemsCount}</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Plural
|
||||
value={allItemsCount}
|
||||
one="# item"
|
||||
other="# items"
|
||||
/>
|
||||
);
|
||||
return allItemsCount <= 1 ? `${allItemsCount} item` : `${allItemsCount} items`;
|
||||
}
|
||||
|
||||
renderHeader() {
|
||||
@@ -455,7 +441,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
|
||||
)}
|
||||
<AddRemoveButtons
|
||||
onRemove={selectedItems.length ? removeItemsDialog : null}
|
||||
removeTooltip={<Trans>Remove selected items ({selectedItems.length})</Trans>}
|
||||
removeTooltip={`Remove selected items (${selectedItems.length})`}
|
||||
{...addRemoveButtons}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import "./page-filters-list.scss";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { Badge } from "../badge";
|
||||
import { cssNames } from "../../utils";
|
||||
import { Filter, pageFilters } from "./page-filters.store";
|
||||
@@ -33,9 +32,9 @@ export class PageFiltersList extends React.Component<Props> {
|
||||
return (
|
||||
<>
|
||||
<div className="header flex gaps">
|
||||
<span><Trans>Currently applied filters:</Trans></span>
|
||||
<span>Currently applied filters:</span>
|
||||
<a onClick={this.reset} className="reset">
|
||||
<Trans>Reset</Trans>
|
||||
Reset
|
||||
</a>
|
||||
</div>
|
||||
<div className="labels">
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { computed } from "mobx";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { GroupSelectOption, Select, SelectOption, SelectProps } from "../select";
|
||||
import { FilterType, pageFilters } from "./page-filters.store";
|
||||
import { namespaceStore } from "../+namespaces/namespace.store";
|
||||
import { Icon } from "../icon";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { FilterIcon } from "./filter-icon";
|
||||
|
||||
export interface SelectOptionFilter extends SelectOption {
|
||||
@@ -36,7 +34,7 @@ export class PageFiltersSelect extends React.Component<Props> {
|
||||
const selectedValues = pageFilters.getValues(FilterType.NAMESPACE);
|
||||
|
||||
options.push({
|
||||
label: <Trans>Namespace</Trans>,
|
||||
label: "Namespace",
|
||||
options: namespaceStore.items.map(ns => {
|
||||
const name = ns.getName();
|
||||
|
||||
@@ -98,8 +96,8 @@ export class PageFiltersSelect extends React.Component<Props> {
|
||||
return (
|
||||
<Select
|
||||
{...selectProps}
|
||||
placeholder={_i18n._(t`Filters (${selectedOptions.length}/${options.length})`)}
|
||||
noOptionsMessage={() => _i18n._(t`No filters available.`)}
|
||||
placeholder={`Filters (${selectedOptions.length}/${options.length})`}
|
||||
noOptionsMessage={() => `No filters available.`}
|
||||
autoConvertOptions={false}
|
||||
tabSelectsValue={false}
|
||||
controlShouldRenderValue={false}
|
||||
@@ -109,4 +107,4 @@ export class PageFiltersSelect extends React.Component<Props> {
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user