Skip to content

Commit 7f19caf

Browse files
feat: workspace constant language support and refactor (#6462)
* chore: workspace constant language support and refactor * chore: workspace constant language support and refactor * chore: code refactor * chore: code refactor * merge conflict * chore: code refactor --------- Co-authored-by: Prateek Shourya <[email protected]>
1 parent 3ec71d6 commit 7f19caf

File tree

32 files changed

+782
-270
lines changed

32 files changed

+782
-270
lines changed

packages/constants/src/workspace.ts

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { TStaticViewTypes } from "@plane/types";
2+
import { EUserWorkspaceRoles } from "./user";
3+
14
export const ORGANIZATION_SIZE = [
25
"Just myself", // TODO: translate
36
"2-10",
@@ -74,3 +77,182 @@ export const RESTRICTED_URLS = [
7477
"instances",
7578
"instance",
7679
];
80+
81+
export const WORKSPACE_SETTINGS = {
82+
general: {
83+
key: "general",
84+
i18n_label: "workspace_settings.settings.general.title",
85+
href: `/settings`,
86+
access: [EUserWorkspaceRoles.ADMIN],
87+
highlight: (pathname: string, baseUrl: string) =>
88+
pathname === `${baseUrl}/settings/`,
89+
},
90+
members: {
91+
key: "members",
92+
i18n_label: "workspace_settings.settings.members.title",
93+
href: `/settings/members`,
94+
access: [EUserWorkspaceRoles.ADMIN],
95+
highlight: (pathname: string, baseUrl: string) =>
96+
pathname === `${baseUrl}/settings/members/`,
97+
},
98+
"billing-and-plans": {
99+
key: "billing-and-plans",
100+
i18n_label: "workspace_settings.settings.billing_and_plans.title",
101+
href: `/settings/billing`,
102+
access: [EUserWorkspaceRoles.ADMIN],
103+
highlight: (pathname: string, baseUrl: string) =>
104+
pathname === `${baseUrl}/settings/billing/`,
105+
},
106+
export: {
107+
key: "export",
108+
i18n_label: "workspace_settings.settings.exports.title",
109+
href: `/settings/exports`,
110+
access: [EUserWorkspaceRoles.ADMIN],
111+
highlight: (pathname: string, baseUrl: string) =>
112+
pathname === `${baseUrl}/settings/exports/`,
113+
},
114+
webhooks: {
115+
key: "webhooks",
116+
i18n_label: "workspace_settings.settings.webhooks.title",
117+
href: `/settings/webhooks`,
118+
access: [EUserWorkspaceRoles.ADMIN],
119+
highlight: (pathname: string, baseUrl: string) =>
120+
pathname === `${baseUrl}/settings/webhooks/`,
121+
},
122+
"api-tokens": {
123+
key: "api-tokens",
124+
i18n_label: "workspace_settings.settings.webhooks.title",
125+
href: `/settings/api-tokens`,
126+
access: [EUserWorkspaceRoles.ADMIN],
127+
highlight: (pathname: string, baseUrl: string) =>
128+
pathname === `${baseUrl}/settings/api-tokens/`,
129+
},
130+
};
131+
132+
export const WORKSPACE_SETTINGS_LINKS: {
133+
key: string;
134+
i18n_label: string;
135+
href: string;
136+
access: EUserWorkspaceRoles[];
137+
highlight: (pathname: string, baseUrl: string) => boolean;
138+
}[] = [
139+
WORKSPACE_SETTINGS["general"],
140+
WORKSPACE_SETTINGS["members"],
141+
WORKSPACE_SETTINGS["billing-and-plans"],
142+
WORKSPACE_SETTINGS["export"],
143+
WORKSPACE_SETTINGS["webhooks"],
144+
WORKSPACE_SETTINGS["api-tokens"],
145+
];
146+
147+
export const ROLE = {
148+
[EUserWorkspaceRoles.GUEST]: "Guest",
149+
[EUserWorkspaceRoles.MEMBER]: "Member",
150+
[EUserWorkspaceRoles.ADMIN]: "Admin",
151+
};
152+
153+
export const ROLE_DETAILS = {
154+
[EUserWorkspaceRoles.GUEST]: {
155+
i18n_title: "role_details.guest.title",
156+
i18n_description: "role_details.guest.description",
157+
},
158+
[EUserWorkspaceRoles.MEMBER]: {
159+
i18n_title: "role_details.member.title",
160+
i18n_description: "role_details.member.description",
161+
},
162+
[EUserWorkspaceRoles.ADMIN]: {
163+
i18n_title: "role_details.admin.title",
164+
i18n_description: "role_details.admin.description",
165+
},
166+
};
167+
168+
export const USER_ROLES = [
169+
{
170+
value: "Product / Project Manager",
171+
i18n_label: "user_roles.product_or_project_manager",
172+
},
173+
{
174+
value: "Development / Engineering",
175+
i18n_label: "user_roles.development_or_engineering",
176+
},
177+
{
178+
value: "Founder / Executive",
179+
i18n_label: "user_roles.founder_or_executive",
180+
},
181+
{
182+
value: "Freelancer / Consultant",
183+
i18n_label: "user_roles.freelancer_or_consultant",
184+
},
185+
{ value: "Marketing / Growth", i18n_label: "user_roles.marketing_or_growth" },
186+
{
187+
value: "Sales / Business Development",
188+
i18n_label: "user_roles.sales_or_business_development",
189+
},
190+
{
191+
value: "Support / Operations",
192+
i18n_label: "user_roles.support_or_operations",
193+
},
194+
{
195+
value: "Student / Professor",
196+
i18n_label: "user_roles.student_or_professor",
197+
},
198+
{ value: "Human Resources", i18n_label: "user_roles.human_resources" },
199+
{ value: "Other", i18n_label: "user_roles.other" },
200+
];
201+
202+
export const IMPORTERS_LIST = [
203+
{
204+
provider: "github",
205+
type: "import",
206+
i18n_title: "importer.github.title",
207+
i18n_description: "importer.github.description",
208+
},
209+
{
210+
provider: "jira",
211+
type: "import",
212+
i18n_title: "importer.jira.title",
213+
i18n_description: "importer.jira.description",
214+
},
215+
];
216+
217+
export const EXPORTERS_LIST = [
218+
{
219+
provider: "csv",
220+
type: "export",
221+
i18n_title: "exporter.csv.title",
222+
i18n_description: "exporter.csv.description",
223+
},
224+
{
225+
provider: "xlsx",
226+
type: "export",
227+
i18n_title: "exporter.excel.title",
228+
i18n_description: "exporter.csv.description",
229+
},
230+
{
231+
provider: "json",
232+
type: "export",
233+
i18n_title: "exporter.json.title",
234+
i18n_description: "exporter.csv.description",
235+
},
236+
];
237+
238+
export const DEFAULT_GLOBAL_VIEWS_LIST: {
239+
key: TStaticViewTypes;
240+
i18n_label: string;
241+
}[] = [
242+
{
243+
key: "all-issues",
244+
i18n_label: "default_global_view.all_issues",
245+
},
246+
{
247+
key: "assigned",
248+
i18n_label: "default_global_view.assigned",
249+
},
250+
{
251+
key: "created",
252+
i18n_label: "default_global_view.created",
253+
},
254+
{
255+
key: "subscribed",
256+
i18n_label: "default_global_view.subscribed",
257+
},
258+
];

packages/i18n/src/locales/en/translations.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,26 @@
683683

684684
"workspace_settings": {
685685
"label": "Workspace settings",
686+
"settings": {
687+
"general": {
688+
"title": "General"
689+
},
690+
"members": {
691+
"title": "Members"
692+
},
693+
"billing-and-plans": {
694+
"title": "Billing & Plans"
695+
},
696+
"exports": {
697+
"title": "Exports"
698+
},
699+
"webhooks": {
700+
"title": "Webhooks"
701+
},
702+
"api-tokens": {
703+
"title": "API Tokens"
704+
}
705+
},
686706
"empty_state": {
687707
"api_tokens": {
688708
"title": "No API tokens created",
@@ -1111,5 +1131,65 @@
11111131
"message": "The sticky could not be removed"
11121132
}
11131133
}
1134+
},
1135+
1136+
"role_details": {
1137+
"guest": {
1138+
"title": "Guest",
1139+
"description": "External members of organizations can be invited as guests."
1140+
},
1141+
"member": {
1142+
"title": "Member",
1143+
"description": "Ability to read, write, edit, and delete entities inside projects, cycles, and modules"
1144+
},
1145+
"admin": {
1146+
"title": "Admin",
1147+
"description": "All permissions set to true within the workspace."
1148+
}
1149+
},
1150+
1151+
"user_roles": {
1152+
"product_or_project_manager": "Product / Project Manager",
1153+
"development_or_engineering": "Development / Engineering",
1154+
"founder_or_executive": "Founder / Executive",
1155+
"freelancer_or_consultant": "Freelancer / Consultant",
1156+
"marketing_or_growth": "Marketing / Growth",
1157+
"sales_or_business_development": "Sales / Business Development",
1158+
"support_or_operations": "Support / Operations",
1159+
"student_or_professor": "Student / Professor",
1160+
"human_or_resources": "Human / Resources",
1161+
"other": "Other"
1162+
},
1163+
1164+
"importer": {
1165+
"github": {
1166+
"title": "Github",
1167+
"description": "Import issues from GitHub repositories and sync them."
1168+
},
1169+
"jira": {
1170+
"title": "Jira",
1171+
"description": "Import issues and epics from Jira projects and epics."
1172+
}
1173+
},
1174+
1175+
"exporter": {
1176+
"csv": {
1177+
"title": "CSV",
1178+
"description": "Export issues to a CSV file."
1179+
},
1180+
"xlsx": {
1181+
"title": "Excel",
1182+
"description": "Export issues to a Excel file."
1183+
},
1184+
"json": {
1185+
"title": "JSON",
1186+
"description": "Export issues to a JSON file."
1187+
}
1188+
},
1189+
"default_global_view": {
1190+
"all_issues": "All issues",
1191+
"assigned": "Assigned",
1192+
"created": "Created",
1193+
"subscribed": "Subscribed"
11141194
}
11151195
}

packages/i18n/src/locales/es/translations.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,26 @@
687687

688688
"workspace_settings": {
689689
"label": "Configuración del espacio de trabajo",
690+
"settings": {
691+
"general": {
692+
"title": "General"
693+
},
694+
"members": {
695+
"title": "Miembros"
696+
},
697+
"billing-and-plans": {
698+
"title": "Facturación y planes"
699+
},
700+
"exports": {
701+
"title": "Exportaciones"
702+
},
703+
"webhooks": {
704+
"title": "Webhooks"
705+
},
706+
"api-tokens": {
707+
"title": "Tokens API"
708+
}
709+
},
690710
"empty_state": {
691711
"api_tokens": {
692712
"title": "No se han creado tokens API",
@@ -1115,5 +1135,66 @@
11151135
"message": "No se pudo eliminar la nota"
11161136
}
11171137
}
1138+
},
1139+
1140+
"role_details": {
1141+
"guest": {
1142+
"title": "Invitado",
1143+
"description": "Los miembros externos de las organizaciones pueden ser invitados como invitados."
1144+
},
1145+
"member": {
1146+
"title": "Miembro",
1147+
"description": "Capacidad para leer, escribir, editar y eliminar entidades dentro de proyectos, ciclos y módulos"
1148+
},
1149+
"admin": {
1150+
"title": "Administrador",
1151+
"description": "Todos los permisos establecidos como verdaderos dentro del espacio de trabajo."
1152+
}
1153+
},
1154+
1155+
"user_roles": {
1156+
"product_or_project_manager": "Gerente de Producto / Proyecto",
1157+
"development_or_engineering": "Desarrollo / Ingeniería",
1158+
"founder_or_executive": "Fundador / Ejecutivo",
1159+
"freelancer_or_consultant": "Freelancer / Consultor",
1160+
"marketing_or_growth": "Marketing / Crecimiento",
1161+
"sales_or_business_development": "Ventas / Desarrollo de Negocios",
1162+
"support_or_operations": "Soporte / Operaciones",
1163+
"student_or_professor": "Estudiante / Profesor",
1164+
"human_or_resources": "Recursos Humanos",
1165+
"other": "Otro"
1166+
},
1167+
1168+
"importer": {
1169+
"github": {
1170+
"title": "Github",
1171+
"description": "Importar problemas desde repositorios de GitHub y sincronizarlos."
1172+
},
1173+
"jira": {
1174+
"title": "Jira",
1175+
"description": "Importar problemas y épicas desde proyectos de Jira."
1176+
}
1177+
},
1178+
1179+
"exporter": {
1180+
"csv": {
1181+
"title": "CSV",
1182+
"description": "Exportar problemas a un archivo CSV."
1183+
},
1184+
"xlsx": {
1185+
"title": "Excel",
1186+
"description": "Exportar problemas a un archivo Excel."
1187+
},
1188+
"json": {
1189+
"title": "JSON",
1190+
"description": "Exportar problemas a un archivo JSON."
1191+
}
1192+
},
1193+
1194+
"default_global_view": {
1195+
"all_issues": "Todos los problemas",
1196+
"assigned": "Asignados",
1197+
"created": "Creados",
1198+
"subscribed": "Suscritos"
11181199
}
11191200
}

0 commit comments

Comments
 (0)