Skip to content
Draft
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
1 change: 1 addition & 0 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"preview": "react-router build && serve -s build/client -l 3001",
"start": "serve -s build/client -l 3001",
"clean": "rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist && rm -rf build",
"check:i18n": "tsx ../../packages/i18n/scripts/check-app-keys.ts",
"check:lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --max-warnings=485",
"check:types": "react-router typegen && tsc --noEmit",
"check:format": "prettier . --cache --check",
Expand Down
5 changes: 3 additions & 2 deletions apps/space/core/components/issues/filters/priority.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { useState } from "react";
import { observer } from "mobx-react";
// plane imports
import { ISSUE_PRIORITY_FILTERS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams} from "@plane/i18n";
import { PriorityIcon } from "@plane/propel/icons";
// local imports
import { FilterHeader } from "./helpers/filter-header";
Expand Down Expand Up @@ -42,7 +43,7 @@ export const FilterPriority = observer(function FilterPriority(props: Props) {
isChecked={appliedFilters?.includes(priority.key) ? true : false}
onClick={() => handleUpdate(priority.key)}
icon={<PriorityIcon priority={priority.key} className="h-3.5 w-3.5" />}
title={t(priority.titleTranslationKey)}
title={t(priority.titleTranslationKey as KeysWithoutParams<"translation">)}
/>
))
) : (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SignalHigh } from "lucide-react";
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams} from "@plane/i18n";
// types
import { PriorityIcon } from "@plane/propel/icons";
import { Tooltip } from "@plane/propel/tooltip";
Expand Down Expand Up @@ -29,7 +30,10 @@ export function IssueBlockPriority({
if (priority_detail === null) return <></>;

return (
<Tooltip tooltipHeading="Priority" tooltipContent={t(priority_detail?.titleTranslationKey || "")}>
<Tooltip
tooltipHeading="Priority"
tooltipContent={t((priority_detail?.titleTranslationKey || "") as KeysWithoutParams<"translation">)}
>
<div
className={cn(
"h-full flex items-center gap-1.5 border-[0.5px] rounded-sm text-11 px-2 py-0.5",
Expand Down Expand Up @@ -59,7 +63,11 @@ export function IssueBlockPriority({
) : (
<SignalHigh className="size-3" />
)}
{shouldShowName && <span className="pl-2 text-13">{t(priority_detail?.titleTranslationKey || "")}</span>}
{shouldShowName && (
<span className="pl-2 text-13">
{t((priority_detail?.titleTranslationKey || "") as KeysWithoutParams<"translation">)}
</span>
)}
</div>
</Tooltip>
);
Expand Down
5 changes: 3 additions & 2 deletions apps/space/core/components/issues/navbar/layout-selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { useRouter, useSearchParams } from "next/navigation";
// ui
import { SITES_ISSUE_LAYOUTS } from "@plane/constants";
// plane i18n
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams} from "@plane/i18n";
import { Tooltip } from "@plane/propel/tooltip";
// helpers
import { queryParamGenerator } from "@/helpers/query-param-generator";
Expand Down Expand Up @@ -47,7 +48,7 @@ export const IssuesLayoutSelection = observer(function IssuesLayoutSelection(pro
if (!layoutOptions[layout.key]) return;

return (
<Tooltip key={layout.key} tooltipContent={t(layout.titleTranslationKey)}>
<Tooltip key={layout.key} tooltipContent={t(layout.titleTranslationKey as KeysWithoutParams<"translation">)}>
<button
type="button"
className={`group grid h-[22px] w-7 place-items-center overflow-hidden rounded-sm transition-all bg-layer-transparent hover:bg-layer-transparent-hover ${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { LinkIcon } from "lucide-react";
// plane imports
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams} from "@plane/i18n";
import {
StatePropertyIcon,
StateGroupIcon,
Expand Down Expand Up @@ -100,7 +101,7 @@ export const PeekOverviewIssueProperties = observer(function PeekOverviewIssuePr
}`}
>
{priority && <PriorityIcon priority={priority?.key} size={12} className="flex-shrink-0" />}
<span>{t(priority?.titleTranslationKey || "common.none")}</span>
<span>{t((priority?.titleTranslationKey || "common.none") as KeysWithoutParams<"translation">)}</span>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions apps/space/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"preview": "react-router build && PORT=3002 react-router-serve ./build/server/index.js",
"start": "PORT=3002 react-router-serve ./build/server/index.js",
"clean": "rm -rf .turbo && rm -rf .next && rm -rf .react-router && rm -rf node_modules && rm -rf dist && rm -rf build",
"check:i18n": "tsx ../../packages/i18n/scripts/check-app-keys.ts",
"check:lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --max-warnings=932",
"check:types": "react-router typegen && tsc --noEmit",
"check:format": "prettier . --cache --check",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { useParams } from "next/navigation";
// plane constants
import { EIssueFilterType, ISSUE_LAYOUTS, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants";
// plane i18n
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams} from "@plane/i18n";
// icons
import { ChevronDownIcon } from "@plane/propel/icons";
// types
Expand Down Expand Up @@ -103,7 +104,7 @@ export const ProfileIssuesMobileHeader = observer(function ProfileIssuesMobileHe
className="flex items-center gap-2"
>
<IssueLayoutIcon layout={ISSUE_LAYOUTS[index].key} className="h-3 w-3" />
<div className="text-tertiary">{t(layout.i18n_title)}</div>
<div className="text-tertiary">{t(layout.i18n_title as KeysWithoutParams<"translation">)}</div>
</CustomMenu.MenuItem>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
import { EIssueFilterType, ISSUE_LAYOUTS, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams} from "@plane/i18n";
import { CalendarLayoutIcon, BoardLayoutIcon, ListLayoutIcon, ChevronDownIcon } from "@plane/propel/icons";
import type { IIssueDisplayFilterOptions, IIssueDisplayProperties, EIssueLayoutTypes } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
Expand Down Expand Up @@ -110,7 +111,7 @@ export const CycleIssuesMobileHeader = observer(function CycleIssuesMobileHeader
className="flex items-center gap-2"
>
<IssueLayoutIcon layout={ISSUE_LAYOUTS[index].key} className="w-3 h-3" />
<div className="text-tertiary">{t(layout.titleTranslationKey)}</div>
<div className="text-tertiary">{t(layout.titleTranslationKey as KeysWithoutParams<"translation">)}</div>
</CustomMenu.MenuItem>
))}
</CustomMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function ProjectCyclesPage({ params }: Route.ComponentProps) {
const resolvedEmptyState = resolvedTheme === "light" ? lightEmptyState : darkEmptyState;
const totalCycles = currentProjectCycleIds?.length ?? 0;
const project = getProjectById(projectId);
const pageTitle = project?.name ? `${project?.name} - ${t("common.cycles", { count: 2 })}` : undefined;
const pageTitle = project?.name ? `${project?.name} - ${t("common.cycles")}` : undefined;
const hasAdminLevelPermission = allowPermissions([EUserProjectRoles.ADMIN], EUserPermissionsLevel.PROJECT);
const hasMemberLevelPermission = allowPermissions(
[EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
import { EIssueFilterType, ISSUE_LAYOUTS, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams} from "@plane/i18n";
import { CalendarLayoutIcon, BoardLayoutIcon, ListLayoutIcon, ChevronDownIcon } from "@plane/propel/icons";
import type { IIssueDisplayFilterOptions, IIssueDisplayProperties, EIssueLayoutTypes } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
Expand Down Expand Up @@ -90,7 +91,7 @@ export const ModuleIssuesMobileHeader = observer(function ModuleIssuesMobileHead
className="flex items-center gap-2"
>
<IssueLayoutIcon layout={ISSUE_LAYOUTS[index].key} className="h-3 w-3" />
<div className="text-tertiary">{t(layout.i18n_title)}</div>
<div className="text-tertiary">{t(layout.i18n_title as KeysWithoutParams<"translation">)}</div>
</CustomMenu.MenuItem>
))}
</CustomMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const GlobalIssuesHeader = observer(function GlobalIssuesHeader() {
onChange={(value: string) => {
router.push(`/${workspaceSlug}/workspace-views/${value}`);
}}
title={viewDetails?.name ?? t(defaultViewDetails?.i18n_label ?? "")}
title={viewDetails?.name ?? (defaultViewDetails?.i18n_label ? t(defaultViewDetails.i18n_label) : "")}
icon={
<Breadcrumbs.Icon>
<ViewsIcon className="size-4 flex-shrink-0 text-tertiary" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { observer } from "mobx-react";
// plane imports
import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams} from "@plane/i18n";
// components
import { NotAuthorizedView } from "@/components/auth-screens/not-authorized-view";
import { PageHead } from "@/components/core/page-title";
Expand Down Expand Up @@ -41,7 +42,9 @@ function MembersSettingsPage({ params }: Route.ComponentProps) {
return (
<SettingsContentWrapper size="lg">
<PageHead title={pageTitle} />
<SettingsHeading title={t(getProjectSettingsPageLabelI18nKey("members", "common.members"))} />
<SettingsHeading
title={t(getProjectSettingsPageLabelI18nKey("members", "common.members") as KeysWithoutParams<"translation">)}
/>
<ProjectSettingsMemberDefaults projectId={projectId} workspaceSlug={workspaceSlug} />
<ProjectTeamspaceList projectId={projectId} workspaceSlug={workspaceSlug} />
<ProjectMemberList projectId={projectId} workspaceSlug={workspaceSlug} />
Expand Down
14 changes: 7 additions & 7 deletions apps/web/app/(all)/profile/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ const WORKSPACE_ACTION_LINKS = [
{
key: "create_workspace",
Icon: CirclePlus,
i18n_label: "create_workspace",
i18n_label: "create_workspace" as const,
href: "/create-workspace",
},
{
key: "invitations",
Icon: Mails,
i18n_label: "workspace_invites",
i18n_label: "workspace_invites" as const,
href: "/invitations",
},
];
] as const;

function ProjectActionIcons({ type, size, className = "" }: { type: string; size?: number; className?: string }) {
const icons = {
Expand Down Expand Up @@ -107,8 +107,8 @@ export const ProfileLayoutSidebar = observer(function ProfileLayoutSidebar() {
.catch(() =>
setToast({
type: TOAST_TYPE.ERROR,
title: t("sign_out.toast.error.title"),
message: t("sign_out.toast.error.message"),
title: t("auth.sign_out.toast.error.title"),
message: t("auth.sign_out.toast.error.message"),
})
)
.finally(() => setIsSigningOut(false));
Expand Down Expand Up @@ -148,7 +148,7 @@ export const ProfileLayoutSidebar = observer(function ProfileLayoutSidebar() {
return (
<Link key={link.key} href={link.href} className="block w-full" onClick={handleItemClick}>
<Tooltip
tooltipContent={t(link.key)}
tooltipContent={t(link.i18n_label)}
position="right"
className="ml-2"
disabled={!sidebarCollapsed}
Expand Down Expand Up @@ -221,7 +221,7 @@ export const ProfileLayoutSidebar = observer(function ProfileLayoutSidebar() {
{WORKSPACE_ACTION_LINKS.map((link) => (
<Link className="block w-full" key={link.key} href={link.href} onClick={handleItemClick}>
<Tooltip
tooltipContent={t(link.key)}
tooltipContent={t(link.i18n_label)}
position="right"
className="ml-2"
disabled={!sidebarCollapsed}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { observer } from "mobx-react";
import { AlertOctagon, BarChart4, CircleDashed, Folder, Microscope, Search } from "lucide-react";
// plane imports
import { MARKETING_PRICING_PAGE_LINK } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams, PrefixedKeyWithoutParams} from "@plane/i18n";

type I18nKey = KeysWithoutParams<"translation"> | PrefixedKeyWithoutParams;
import { getButtonStyling } from "@plane/propel/button";
import { ContentWrapper } from "@plane/ui";
import { cn } from "@plane/utils";
Expand All @@ -20,46 +23,46 @@ import { useUser } from "@/hooks/store/user";

export const WORKSPACE_ACTIVE_CYCLES_DETAILS = [
{
key: "10000_feet_view",
key: "10000_feet_view" as const,
title: "10,000-feet view of all active cycles.",
description:
"Zoom out to see running cycles across all your projects at once instead of going from Cycle to Cycle in each project.",
icon: Folder,
},
{
key: "get_snapshot_of_each_active_cycle",
key: "get_snapshot_of_each_active_cycle" as const,
title: "Get a snapshot of each active cycle.",
description:
"Track high-level metrics for all active cycles, see their state of progress, and get a sense of scope against deadlines.",
icon: CircleDashed,
},
{
key: "compare_burndowns",
key: "compare_burndowns" as const,
title: "Compare burndowns.",
description: "Monitor how each of your teams are performing with a peek into each cycles burndown report.",
description: "Monitor how each of your teams are performing with a peek into each cycle's burndown report.",
icon: BarChart4,
},
{
key: "quickly_see_make_or_break_issues",
key: "quickly_see_make_or_break_issues" as const,
title: "Quickly see make-or-break work items. ",
description:
"Preview high-priority work items for each cycle against due dates. See all of them per cycle in one click.",
icon: AlertOctagon,
},
{
key: "zoom_into_cycles_that_need_attention",
key: "zoom_into_cycles_that_need_attention" as const,
title: "Zoom into cycles that need attention. ",
description: "Investigate the state of any cycle that doesnt conform to expectations in one click.",
description: "Investigate the state of any cycle that doesn't conform to expectations in one click.",
icon: Search,
},
{
key: "stay_ahead_of_blockers",
key: "stay_ahead_of_blockers" as const,
title: "Stay ahead of blockers.",
description:
"Spot challenges from one project to another and see inter-cycle dependencies that arent obvious from any other view.",
"Spot challenges from one project to another and see inter-cycle dependencies that aren't obvious from any other view.",
icon: Microscope,
},
];
] as const;

export const WorkspaceActiveCyclesUpgrade = observer(function WorkspaceActiveCyclesUpgrade() {
const { t } = useTranslation();
Expand Down Expand Up @@ -118,7 +121,7 @@ export const WorkspaceActiveCyclesUpgrade = observer(function WorkspaceActiveCyc
<h3 className="font-medium">{t(item.key)}</h3>
<item.icon className="mt-1 h-4 w-4 text-blue-500" />
</div>
<span className="text-13 text-tertiary">{t(`${item.key}_description`)}</span>
<span className="text-13 text-tertiary">{t(`${item.key}_description` as I18nKey)}</span>
</div>
))}
</div>
Expand Down
9 changes: 6 additions & 3 deletions apps/web/ce/components/preferences/theme-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { useTheme } from "next-themes";
// plane imports
import type { I_THEME_OPTION } from "@plane/constants";
import { THEME_OPTIONS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams, PrefixedKeyWithoutParams} from "@plane/i18n";
import { setPromiseToast } from "@plane/propel/toast";
// components
import { CustomThemeSelector } from "@/components/core/theme/custom-theme-selector";
Expand All @@ -14,11 +15,13 @@ import { PreferencesSection } from "@/components/preferences/section";
// hooks
import { useUserProfile } from "@/hooks/store/user";

type I18nKey = KeysWithoutParams<"translation"> | PrefixedKeyWithoutParams;

export const ThemeSwitcher = observer(function ThemeSwitcher(props: {
option: {
id: string;
title: string;
description: string;
title: I18nKey;
description: I18nKey;
};
}) {
// store hooks
Expand Down
11 changes: 7 additions & 4 deletions apps/web/ce/components/projects/create/attributes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import type { FC } from "react";
import { Controller, useFormContext } from "react-hook-form";
// plane imports
import { NETWORK_CHOICES, ETabIndices } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { useTranslation } from "@plane/i18n";
import type {KeysWithoutParams, PrefixedKeyWithoutParams} from "@plane/i18n";
import type { IProject } from "@plane/types";
import { CustomSelect } from "@plane/ui";
import { getTabIndex } from "@plane/utils";
// components
import { MemberDropdown } from "@/components/dropdowns/member/dropdown";
import { ProjectNetworkIcon } from "@/components/project/project-network-icon";

type I18nKey = KeysWithoutParams<"translation"> | PrefixedKeyWithoutParams;

type Props = {
isMobile?: boolean;
};
Expand Down Expand Up @@ -37,7 +40,7 @@ function ProjectAttributes(props: Props) {
{currentNetwork ? (
<>
<ProjectNetworkIcon iconKey={currentNetwork.iconKey} />
{t(currentNetwork.i18n_label)}
{t(currentNetwork.i18n_label as I18nKey)}
</>
) : (
<span className="text-placeholder">{t("select_network")}</span>
Expand All @@ -55,8 +58,8 @@ function ProjectAttributes(props: Props) {
<div className="flex items-start gap-2">
<ProjectNetworkIcon iconKey={network.iconKey} className="h-3.5 w-3.5" />
<div className="-mt-1">
<p>{t(network.i18n_label)}</p>
<p className="text-11 text-placeholder">{t(network.description)}</p>
<p>{t(network.i18n_label as I18nKey)}</p>
<p className="text-11 text-placeholder">{t(network.description as I18nKey)}</p>
</div>
</div>
</CustomSelect.Option>
Expand Down
Loading
Loading