Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Commit 4d1d7d1

Browse files
authored
Improves i18n and allows for toggling to simplified Chinese (#632)
1 parent eac555c commit 4d1d7d1

File tree

8 files changed

+35
-15
lines changed

8 files changed

+35
-15
lines changed

apps/ui/public/locales/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,15 @@
215215
"options": "Options",
216216
"pending": "Pending",
217217
"period": "Period",
218+
"performance": "Performance",
218219
"phone": "Phone",
219220
"plain_text": "Plain Text",
220221
"preheader": "Preheader",
221222
"preview": "Preview",
222223
"project": "Project",
224+
"projects": "Projects",
225+
"projects_all": "All Projects",
226+
"projects_description": "Projects are isolated workspaces with their own sets of users, events, lists, campaigns, and journeys.",
223227
"project_settings_saved": "Project settings saved!",
224228
"provider": "Provider",
225229
"publish": "Publish",
@@ -233,6 +237,7 @@
233237
"rebuild_path_suggestions": "Rebuild Path Suggestions",
234238
"rebuild_path_suggestions_desc": "Would you like to recreate all of the event and user data autocomplete paths used for creating rules?",
235239
"rebuild_path_suggestions_success": "Path suggestions are rebuilding. This might take a few minutes depending on how many users and events you have.",
240+
"recently_viewed": "Recently Viewed",
236241
"remove": "Remove",
237242
"remove_locale_warning": "Are you sure you want to delete this locale? The template cannot be recovered.",
238243
"reply_to": "Reply To",

apps/ui/public/locales/es.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,15 @@
215215
"options": "Opciones",
216216
"pending": "Pendiente",
217217
"period": "Período",
218+
"performance": "Rendimiento",
218219
"phone": "Teléfono",
219220
"plain_text": "Texto sin formato",
220221
"preheader": "Preencabezado",
221222
"preview": "Previsualizar",
222223
"project": "Proyecto",
224+
"projects": "Projectos",
225+
"projects_all": "Todos Projects",
226+
"projects_description": "Los proyectos son espacios de trabajo aislados con sus propios usuarios, eventos, listas, campañas y caminos.",
223227
"project_settings_saved": "¡Ajustes del proyecto guardados!",
224228
"provider": "Proveedor",
225229
"publish": "Publicar",
@@ -233,6 +237,7 @@
233237
"rebuild_path_suggestions": "Reconstruir las Sugerencias de Ruta",
234238
"rebuild_path_suggestions_desc": "¿Le gustaría recrear todas las rutas de autocompletado de datos de eventos y usuarios utilizadas para crear reglas?",
235239
"rebuild_path_suggestions_success": "Las sugerencias de ruta se están reconstruyendo. Esto puede tardar unos minutos dependiendo de cuántos usuarios y eventos tengas.",
240+
"recently_viewed": "Visto Recientemente",
236241
"remove": "Eliminar",
237242
"remove_locale_warning": "¿Está seguro de que desea eliminar esta configuración regional? La plantilla no se puede recuperar.",
238243
"reply_to": "Responder a",

apps/ui/public/locales/zh.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,15 @@
215215
"options": "选项",
216216
"pending": "待处理",
217217
"period": "周期",
218+
"performance": "表现",
218219
"phone": "电话",
219220
"plain_text": "纯文本",
220221
"preheader": "预标题",
221222
"preview": "预览",
222223
"project": "项目",
224+
"projects": "项目",
225+
"projects_all": "所有项目",
226+
"projects_description": "项目是独立的工作区,拥有自己的用户、事件、列表、活动和旅程。",
223227
"project_settings_saved": "项目设置已保存!",
224228
"provider": "提供商",
225229
"publish": "发布",
@@ -233,6 +237,7 @@
233237
"rebuild_path_suggestions": "重建路径建议",
234238
"rebuild_path_suggestions_desc": "您想重新创建用于创建规则的所有事件和用户数据自动完成路径吗?",
235239
"rebuild_path_suggestions_success": "正在重建路径建议。这可能需要几分钟,具体取决于您有多少用户和事件。",
240+
"recently_viewed": "最近浏览",
236241
"remove": "移除",
237242
"remove_locale_warning": "您确定要删除此地区吗?模板无法恢复。",
238243
"reply_to": "回复至",

apps/ui/src/ui/Sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ export default function Sidebar({ children, links, prepend, append }: PropsWithC
8989
{children}
9090
</main>
9191

92-
<Modal open={isLanguageOpen} onClose={() => setIsLanguageOpen(false)} title={'Language'}>
93-
<RadioInput label={t('language')} options={[{ label: 'English', key: 'en' }, { label: 'Espańol', key: 'es' }]} value={i18n.language} onChange={(value) => {
92+
<Modal open={isLanguageOpen} onClose={() => setIsLanguageOpen(false)} title={t('language')}>
93+
<RadioInput label={t('language')} options={[{ label: 'English', key: 'en' }, { label: 'Español', key: 'es' }, { label: '简体中文', key: 'zh' }]} value={i18n.language} onChange={(value) => {
9494
setPreferences({ ...preferences, lang: value })
9595
}} />
9696
</Modal>

apps/ui/src/views/organization/Organization.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { checkOrganizationRole } from '../../utils'
66
import { StatefulLoaderContextProvider } from '../LoaderContextProvider'
77
import { OrganizationRole } from '../../types'
88
import { Outlet } from 'react-router-dom'
9+
import { Translation } from 'react-i18next'
910

1011
type OrganizationLink = SidebarLink & { minRole?: OrganizationRole }
1112
interface OrganizationProps {
@@ -18,27 +19,27 @@ export default function Organization({ filter }: OrganizationProps) {
1819
{
1920
key: 'projects',
2021
to: 'projects',
21-
children: 'Projects',
22+
children: <Translation>{ t => t('projects') }</Translation>,
2223
icon: <ProjectIcon />,
2324
},
2425
{
2526
key: 'admins',
2627
to: 'admins',
27-
children: 'Admins',
28+
children: <Translation>{ t => t('admins') }</Translation>,
2829
icon: <UsersIcon />,
2930
minRole: 'admin',
3031
},
3132
{
3233
key: 'performance',
3334
to: 'performance',
34-
children: 'Performance',
35+
children: <Translation>{ t => t('performance') }</Translation>,
3536
icon: <PerformanceIcon />,
3637
minRole: 'admin',
3738
},
3839
{
3940
key: 'settings',
4041
to: 'settings',
41-
children: 'Settings',
42+
children: <Translation>{ t => t('settings') }</Translation>,
4243
icon: <SettingsIcon />,
4344
minRole: 'admin',
4445
},

apps/ui/src/views/organization/Performance.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export default function Performance() {
136136

137137
return (
138138
<PageContent
139-
title="Performance"
139+
title={t('performance')}
140140
desc="View queue throughput for your project."
141141
>
142142
<Heading size="h3" title="Queue" />

apps/ui/src/views/organization/Settings.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import Heading from '../../ui/Heading'
88
import api from '../../api'
99
import { toast } from 'react-hot-toast/headless'
1010
import { Button } from '../../ui'
11+
import { useTranslation } from 'react-i18next'
1112

1213
export default function Settings() {
1314
const profile = useContext(AdminContext)
15+
const { t } = useTranslation()
1416
const [organization] = useContext(OrganizationContext)
1517
const deleteOrganization = async () => {
1618
if (confirm('Are you sure you want to delete this organization?')) {
@@ -24,7 +26,7 @@ export default function Settings() {
2426

2527
return (
2628
<>
27-
<PageContent title="Settings">
29+
<PageContent title={t('settings')}>
2830
<FormWrapper<Organization>
2931
defaultValues={organization}
3032
disabled={!owner}
@@ -36,7 +38,7 @@ export default function Settings() {
3638
submitLabel="Save Settings"
3739
>
3840
{form => <>
39-
<Heading size="h3" title="General" />
41+
<Heading size="h3" title={t('general')} />
4042
<TextInput.Field
4143
form={form}
4244
disabled={!owner}

apps/ui/src/views/project/Projects.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ import logoUrl from '../../assets/parcelvoylogo.png'
1212
import { PlusIcon } from '../../ui/icons'
1313
import Modal from '../../ui/Modal'
1414
import ProjectForm from './ProjectForm'
15+
import { useTranslation } from 'react-i18next'
1516

1617
export function Projects() {
1718
const navigate = useNavigate()
19+
const { t } = useTranslation()
1820
const [preferences] = useContext(PreferencesContext)
1921
const [projects] = useResolver(api.projects.all)
2022
const recents = useMemo(() => {
@@ -44,22 +46,22 @@ export function Projects() {
4446

4547
return (
4648
<PageContent
47-
title="Projects"
48-
desc="Projects are isolated workspaces with their own sets of users, events, lists, campaigns, and journeys."
49+
title={t('projects')}
50+
desc={t('projects_description')}
4951
actions={
5052
<Button
5153
variant="primary"
5254
icon={<PlusIcon />}
5355
onClick={() => setOpen(true)}
5456
>
55-
{'Create Project'}
57+
{t('create_project')}
5658
</Button>
5759
}
5860
>
5961
{
6062
!!recents?.length && (
6163
<>
62-
<h3>Recently Visited</h3>
64+
<h3>{t('recently_viewed')}</h3>
6365
<TileGrid>
6466
{
6567
recents.map(({ project, when }) => (
@@ -77,7 +79,7 @@ export function Projects() {
7779
</>
7880
)
7981
}
80-
<h3>All Projects</h3>
82+
<h3>{t('projects_all')}</h3>
8183
<TileGrid>
8284
{
8385
projects?.map(project => (
@@ -95,7 +97,7 @@ export function Projects() {
9597
<Modal
9698
open={open}
9799
onClose={setOpen}
98-
title="Create Project"
100+
title={t('create_project')}
99101
size="regular"
100102
>
101103
<ProjectForm

0 commit comments

Comments
 (0)