Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate build:nlsExtract from package.json for webview localization #3263

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/zowe-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@
]
},
"scripts": {
"build": "pnpm copy-secrets && pnpm clean:bundle && pnpm license && pnpm build:nls && webpack --mode development && pnpm madge",
"build": "pnpm copy-secrets && pnpm clean:bundle && pnpm license && pnpm build:nls && webpack --mode development && pnpm madge",
"test": "pnpm test:unit",
"test:e2e": "cd __tests__/__e2e__/ && wdio run ./wdio.conf.ts",
"test:integration": "cd __tests__/__integration__/bdd && wdio run ./wdio.conf.ts",
Expand All @@ -1795,9 +1795,8 @@
"pretty": "prettier --write .",
"generateLocalization": "pnpm dlx @vscode/l10n-dev export --o ./l10n ./src && node ./scripts/generatePoeditorJson.js",
"copy-secrets": "node ./scripts/getSecretsPrebuilds.js",
"build:nlsExtract": "pnpm dlx @vscode/l10n-dev export --outDir ./l10n ./src",
"build:nlsPseudo": "pnpm dlx @vscode/l10n-dev generate-pseudo -o ./l10n/ ./l10n/bundle.l10n.json ./package.nls.json",
"build:nls": "pnpm run build:nlsExtract && pnpm run build:nlsPseudo"
"build:nls": "pnpm run build:nlsPseudo"
},
"engines": {
"vscode": "^1.79.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
import { createContext } from "preact";
import { DataPanelContextType } from "../types";
import { useContext } from "preact/hooks";
import * as l10n from "@vscode/l10n";

export const DataPanelContext = createContext<DataPanelContextType | null>(null);

export function useDataPanelContext(): DataPanelContextType {
const dataPanelContext = useContext(DataPanelContext);
if (!dataPanelContext) {
throw new Error(l10n.t("DataPanelContext has to be used within <DataPanelContext.Provider>"));
throw new Error("DataPanelContext has to be used within <DataPanelContext.Provider>");
}
return dataPanelContext;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export const ActionsBar = (props: ActionsProps) => {
</h3>
<span style={{ display: "flex", alignItems: "center", marginBottom: "0.25em" }}>
<p style={{ fontSize: "0.9em", paddingTop: "2px", marginRight: "0.75em" }}>
{props.selectionCount === 0 ? l10n.t("No") : props.selectionCount} {l10n.t("item")}
{props.selectionCount > 1 || props.selectionCount === 0 ? l10n.t("s") : ""} {l10n.t("selected")}
{props.selectionCount === 0 ? l10n.t("No") : props.selectionCount}
{props.selectionCount > 1 || props.selectionCount === 0 ? l10n.t("items") : l10n.t("item")} {l10n.t("selected")}
</p>
{props.actions
.filter((action) => (props.itemCount > 1 ? action.callback.typ === "multi-row" : action.callback.typ.endsWith("row")))
Expand Down