Skip to content

Commit 1ec3926

Browse files
committed
[gephi-lite] i18n check unused
1 parent 7c0751e commit 1ec3926

File tree

8 files changed

+53
-157
lines changed

8 files changed

+53
-157
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
env:
4343
NODE_OPTIONS: --max_old_space_size=4096
4444

45+
- name: Check I18N
46+
run: npm run i18n-checker --workspace=@gephi/gephi-lite
47+
4548
- name: Run unit tests
4649
run: npm run test
4750

packages/gephi-lite/scripts/i18n-checker.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,36 @@ const LANGUAGES = ["dev"];
88

99
const IGNORE_MISSING: RegExp[] = [];
1010

11-
const IGNORE_UNUSED: RegExp[] = [];
11+
const IGNORE_UNUSED: RegExp[] = [
12+
/appearance\.title/,
13+
/filters\.title/,
14+
/error\.form\..*/,
15+
/search\..*/,
16+
/common\..*/,
17+
/selection\..*/,
18+
/layouts\..*/,
19+
/metrics\..*/,
20+
/edition\.data_creation/,
21+
/edition\.update_this_nodes/,
22+
/edition\.update_this_edges/,
23+
/edition\.delete_this_nodes/,
24+
/edition\.delete_this_edges/,
25+
/edition\.delete_nodes/,
26+
/edition\.delete_edges/,
27+
/edition\.merge_selected_nodes/,
28+
/edition\.search_nodes/,
29+
/edition\.all_nodes/,
30+
/edition\.filtered_nodes/,
31+
/edition\.selected_nodes/,
32+
/edition\.all_edges/,
33+
/edition\.filtered_edges/,
34+
/edition\.selected_edges/,
35+
/datatable\..*_matching/,
36+
/datatable\.protected_columns\.degree/,
37+
/datatable\.protected_columns\.sourceId/,
38+
/datatable\.protected_columns\.targetId/,
39+
/datatable\.save_and_create_column/,
40+
];
1241

1342
/**
1443
* Read a file and returns its content as a JSON

packages/gephi-lite/src/components/GraphFilters/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const FilterInStack: FC<{
3434
<div className="filter-buttons">
3535
<button
3636
className="gl-btn gl-heading-3 fw-bold w-100 d-flex"
37+
title={t("filters.desactivated")}
3738
onClick={(e) => {
3839
e.stopPropagation();
3940
updateFilter(filterIndex, { ...filter, disabled: !filter.disabled });

packages/gephi-lite/src/components/data/EditMultipleItems.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ export const useEditMultipleItemsForm = ({ onSubmitted, onCancel, type, items }:
5656
notify({
5757
type: "success",
5858
title: t(`edition.update_multiple_${type}`),
59-
message: t(`edition.update_multiple_${type}_success`),
59+
message: t(`edition.update_multiple_${type}_success`, { count: items.size }),
6060
});
6161
onSubmitted();
6262
} catch (e) {
6363
notify({
6464
type: "error",
65-
title: t("edition.update_items", { type }),
65+
title: t(`edition.update_multiple_${type}`),
6666
message: (e as Error).message || t("error.unknown"),
6767
});
6868
}

packages/gephi-lite/src/components/modals/SelectFilterModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const SelectFilterModal: FC<
4646
return (
4747
<Modal title={t("filters.add_filter")} onClose={() => cancel()} className="modal-lg">
4848
<>
49-
<p>What kind of filter do you want to create?</p>
49+
<p>{t("filters.create.what_kind")}</p>
5050

5151
<section className="mb-4">
5252
<h2>{t("filters.topological")}</h2>

packages/gephi-lite/src/components/modals/open/CloudFileModal.tsx

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ import { useTranslation } from "react-i18next";
55

66
import { CloudFile } from "../../../core/cloud/types";
77
import { useCloudProvider } from "../../../core/cloud/useCloudProvider";
8-
import { ModalProps } from "../../../core/modals/types";
98
import { useNotifications } from "../../../core/notifications";
109
import { useConnectedUser } from "../../../core/user";
1110
import { displayDateTime } from "../../../utils/date";
1211
import type { AsyncStatus } from "../../../utils/promises";
1312
import { Loader } from "../../Loader";
1413
import { ExternalLinkIcon, LockIcon, SyncIcon } from "../../common-icons";
15-
import { Modal } from "../../modals";
1614
import { PleaseSignIn } from "../../user/PleaseSignIn";
1715

1816
const PAGINATION_SIZE = 12;
@@ -114,7 +112,7 @@ export const OpenCloudFileForm: FC<OpenCloudFileFormProps> = ({ id, onStatusChan
114112
href={file.webUrl}
115113
title={t("graph.open.github.file-open-external", {
116114
filename: file.filename,
117-
provider: user?.provider.type ? t(`providers.${user.provider.type}`) : null,
115+
provider: t(`providers.github`),
118116
}).toString()}
119117
target="_blank"
120118
rel="noreferrer"
@@ -141,7 +139,7 @@ export const OpenCloudFileForm: FC<OpenCloudFileFormProps> = ({ id, onStatusChan
141139
{!loading && files.length === 0 && (
142140
<p className="text-info">
143141
{t("graph.open.github.no-data", {
144-
provider: user?.provider.type ? t(`providers.${user.provider.type}`) : null,
142+
provider: t(`providers.github`),
145143
}).toString()}
146144
</p>
147145
)}
@@ -153,28 +151,3 @@ export const OpenCloudFileForm: FC<OpenCloudFileFormProps> = ({ id, onStatusChan
153151
</>
154152
);
155153
};
156-
157-
export const OpenCloudFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
158-
const { t } = useTranslation();
159-
const [status, setStatus] = useState<AsyncStatus>({ type: "idle" });
160-
const [user] = useConnectedUser();
161-
162-
useEffect(() => {
163-
// closing the modal on success
164-
if (status.type === "success") cancel();
165-
}, [status, cancel]);
166-
167-
return (
168-
<Modal title={t("graph.open.local.title").toString()}>
169-
<>{user ? <OpenCloudFileForm id={"remoteFileForm"} onStatusChange={(s) => setStatus(s)} /> : <PleaseSignIn />}</>
170-
<div className="gl-gap-2 d-flex">
171-
<button title={t("common.cancel").toString()} className="gl-btn gl-btn-outline" onClick={() => cancel()}>
172-
{t("common.cancel").toString()}
173-
</button>
174-
<button className="gl-btn gl-btn-fill" form="localFileForm" disabled={status.type === "loading"}>
175-
{t("common.open").toString()}
176-
</button>
177-
</div>
178-
</Modal>
179-
);
180-
};

0 commit comments

Comments
 (0)