diff --git a/apps/app/src/components/status-policies.tsx b/apps/app/src/components/status-policies.tsx index cf2efad284..44ab6eb659 100644 --- a/apps/app/src/components/status-policies.tsx +++ b/apps/app/src/components/status-policies.tsx @@ -21,6 +21,26 @@ const STATUS_COLORS: Record = { "not-relevant": "#ff0000", } as const; +// Map status types to translation keys +const getStatusTranslation = (status: StatusType, t: ReturnType) => { + switch (status) { + case "draft": + return t("policies.status.draft"); + case "published": + return t("policies.status.published"); + case "archived": + return t("policies.status.archived"); + case "needs_review": + return t("policies.status.needs_review"); + case "relevant": + return t("policies.status.relevant"); + case "not-relevant": + return t("policies.status.not-relevant"); + default: + return status; + } +}; + export function StatusPolicies({ status, className, @@ -38,7 +58,7 @@ export function StatusPolicies({ className={cn("size-2.5")} style={{ backgroundColor: STATUS_COLORS[status] ?? " " }} /> - {withLabel ? t(`policies.status.${status}`) : null} + {withLabel ? getStatusTranslation(status, t) : null} ); } diff --git a/apps/app/src/locales/analyze-locale-usage.ts b/apps/app/src/locales/analyze-locale-usage.ts index 6b77753f7f..ce0ff9c1fe 100644 --- a/apps/app/src/locales/analyze-locale-usage.ts +++ b/apps/app/src/locales/analyze-locale-usage.ts @@ -16,6 +16,13 @@ const SEARCH_DIRECTORIES = ['./src', './../portal/src'] // Always exclude node_modules from search const EXCLUDE_DIR = '--exclude-dir=node_modules' +// Keys to exclude from unused check +// Supports wildcards with * at the end, e.g. 'common.frequency.*' +const EXCLUDE_KEYS = [ + 'common.frequency.*', + 'common.status.*', +] + // ANSI color codes for terminal output - using a minimal set const COLORS = { reset: '\x1b[0m', @@ -118,6 +125,20 @@ async function findTranslationIssues(findUnused: boolean, findDuplicates: boolea process.stdout.write(`\r${COLORS.gray}Progress: ${percent}% (${count}/${total})${COLORS.reset}`) } + // Skip excluded keys - now with wildcard support + const isExcluded = EXCLUDE_KEYS.some(excludePattern => { + if (excludePattern.endsWith('*')) { + // For wildcard patterns, check if the key starts with the pattern minus the * + const prefix = excludePattern.slice(0, -1) + return key.startsWith(prefix) + } + return key === excludePattern + }) + + if (isExcluded) { + continue + } + const isUsed = await isKeyUsedInCode(key) if (!isUsed) { unusedKeys.push(key) diff --git a/apps/app/src/locales/auth/onboarding.ts b/apps/app/src/locales/auth/onboarding.ts index efd0949f96..e1f6a55e0d 100644 --- a/apps/app/src/locales/auth/onboarding.ts +++ b/apps/app/src/locales/auth/onboarding.ts @@ -31,4 +31,5 @@ export const onboarding = { success: "Thanks, you're all set!", error: "Something went wrong, please try again.", creating: "Creating your organization...", + switch: "Switching organization...", } as const \ No newline at end of file diff --git a/apps/app/src/locales/core/common.ts b/apps/app/src/locales/core/common.ts index 6cdbaad920..301f8cffc6 100644 --- a/apps/app/src/locales/core/common.ts +++ b/apps/app/src/locales/core/common.ts @@ -39,6 +39,9 @@ export const common = { needs_review: "Needs Review", draft: "Draft", not_assessed: "Not Assessed", + assessed: "Assessed", + active: "Active", + inactive: "Inactive", title: "Status", }, filters: { @@ -143,4 +146,9 @@ export const common = { edit: "Edit", description: "Description", last_updated: "Last Updated", + frequency: { + monthly: "Monthly", + quarterly: "Quarterly", + yearly: "Yearly" + } } as const \ No newline at end of file diff --git a/apps/app/src/locales/en.ts b/apps/app/src/locales/en.ts index 9067e20181..a50985109f 100644 --- a/apps/app/src/locales/en.ts +++ b/apps/app/src/locales/en.ts @@ -1,5 +1,3 @@ -import type { DeepReadonly } from 'next/dist/shared/lib/deep-readonly' - // Core translations used across the application import { common } from './core/common' import { errors } from './core/errors' @@ -29,7 +27,7 @@ import { vendors } from './features/vendors' // Settings translations import { settings } from './settings/settings' -const translations = { +export const translations = { // Core common, errors, @@ -63,4 +61,4 @@ const translations = { } as const export type Translations = typeof translations -export default translations as DeepReadonly +export default translations diff --git a/apps/app/src/locales/features/policies.ts b/apps/app/src/locales/features/policies.ts index 788d0f6484..e6f0a3069c 100644 --- a/apps/app/src/locales/features/policies.ts +++ b/apps/app/src/locales/features/policies.ts @@ -62,6 +62,8 @@ export const policies = { published: "Published", needs_review: "Needs Review", archived: "Archived", + relevant: "Relevant", + "not-relevant": "Not Relevant" }, policies: "policies", title: "Policies", diff --git a/apps/app/src/locales/features/risk.ts b/apps/app/src/locales/features/risk.ts index 61b1abe1cf..505e3eb9ee 100644 --- a/apps/app/src/locales/features/risk.ts +++ b/apps/app/src/locales/features/risk.ts @@ -7,10 +7,16 @@ export const risk = { form: { update_inherent_risk_success: "Inherent risk updated successfully", update_inherent_risk_error: "Failed to update inherent risk", + update_inherent_risk: "Update Inherent Risk", + update_inherent_risk_description: "Adjust the inherent risk before any controls are applied", update_residual_risk_success: "Residual risk updated successfully", update_residual_risk_error: "Failed to update residual risk", + update_residual_risk: "Update Residual Risk", + update_residual_risk_description: "Adjust the residual risk after controls have been applied", update_risk_success: "Risk updated successfully", update_risk_error: "Failed to update risk", + update_risk: "Update Risk", + update_risk_description: "Update risk details and metadata", create_risk_success: "Risk created successfully", create_risk_error: "Failed to create risk", risk_title: "Risk Title", @@ -20,6 +26,8 @@ export const risk = { risk_category_placeholder: "Select risk category", risk_description: "Description", risk_description_description: "Enter risk description", + risk_department: "Department", + risk_department_placeholder: "Select department", risk_status: "Status", risk_status_placeholder: "Select status" }, @@ -29,22 +37,38 @@ export const risk = { risk: "Risk" }, empty: { - create_risk: "Create Risk" + create_risk: "Create Risk", + no_risks: { + title: "No risks yet", + description: "Get started by creating your first risk" + } } }, dashboard: { title: "Risk Dashboard", by_department: "Risks by Department", status: "Risks by Status", - risks_by_assignee: "Risks by Assignee" + risks_by_assignee: "Risks by Assignee", + overview: "Overview", + inherent_risk_description: "Initial risk level before any controls are applied", + residual_risk_description: "Remaining risk level after controls are applied" }, metrics: { probability: "Probability", - impact: "Impact" + impact: "Impact", + inherentRisk: "Inherent Risk", + residualRisk: "Residual Risk" }, tasks: { title: "Tasks", task_overview: "Task Overview", + attachments: "Attachments", + overview: "Overview", + sheet: { + title: "Create Task", + update: "Update Task", + update_description: "Update task details and metadata" + }, form: { title: "Task Details", task_title: "Task Title", diff --git a/apps/app/src/locales/settings/settings.ts b/apps/app/src/locales/settings/settings.ts index e3faf647ca..de19dc6589 100644 --- a/apps/app/src/locales/settings/settings.ts +++ b/apps/app/src/locales/settings/settings.ts @@ -18,6 +18,7 @@ export const settings = { org_delete_alert_description: "This action cannot be undone. This will permanently delete your organization and remove your data from our servers.", delete_confirm_tip: "Type 'delete' to confirm", + delete_confirm: "delete", org_delete_error: "Error deleting organization", org_delete_success: "Organization deleted", org_name_updated: "Organization name updated", @@ -91,6 +92,10 @@ export const settings = { description: "There are no active members in your organization", }, }, + status: { + accepted: "Accepted", + pending: "Pending" + }, role: { owner: "Owner", admin: "Admin", @@ -139,7 +144,8 @@ export const settings = { "Send an invitation to a new team member to join your organization", error: { title: "Invitation Error", - description: "There was an error processing your invitation." + description: "There was an error processing your invitation.", + home: "Go to Home" }, form: { email: {