Skip to content

Commit f1915d5

Browse files
committed
Add i18n support for home panel header and task placeholder text
1 parent 2908668 commit f1915d5

4 files changed

Lines changed: 44 additions & 2 deletions

File tree

‎apps/editor/src/views/i18n/panel.ts‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
export const panel = {
2+
'panel.header.home': {
3+
en: 'Hello!',
4+
pl: 'Cześć!',
5+
'zh-cn': '你好!',
6+
ja: 'こんにちは!',
7+
'zh-tw': '你好!',
8+
de: 'Hallo!',
9+
es: '¡Hola!',
10+
fr: 'Salut !',
11+
'pt-br': 'Olá!',
12+
ru: 'Привет!',
13+
ko: '안녕하세요!',
14+
it: 'Ciao!',
15+
tr: 'Merhaba!',
16+
cs: 'Ahoj!',
17+
hu: 'Szia!',
18+
bg: 'Здравей!'
19+
},
220
'panel.header.settings': {
321
en: 'Settings',
422
pl: 'Ustawienia',
@@ -89,6 +107,24 @@ export const panel = {
89107
hu: 'Feladat hozzáadása',
90108
bg: 'Добавяне на задача'
91109
},
110+
'panel.home.tasks.placeholder': {
111+
en: 'Click to add text...',
112+
pl: 'Kliknij, aby dodać tekst...',
113+
'zh-cn': '点击添加文本...',
114+
ja: 'クリックしてテキストを追加...',
115+
'zh-tw': '點擊添加文本...',
116+
de: 'Klicken, um Text hinzuzufügen...',
117+
es: 'Haga clic para añadir texto...',
118+
fr: 'Cliquez pour ajouter du texte...',
119+
'pt-br': 'Clique para adicionar texto...',
120+
ru: 'Нажмите, чтобы добавить текст...',
121+
ko: '텍스트를 추가하려면 클릭하세요...',
122+
it: 'Clicca per aggiungere testo...',
123+
tr: 'Metin eklemek için tıklayın...',
124+
cs: 'Kliknutím přidáte text...',
125+
hu: 'Kattintson szöveg hozzáadásához...',
126+
bg: 'Кликнете, за да добавите текст...'
127+
},
92128
'panel.home.timeline': {
93129
en: 'Timeline',
94130
pl: 'Oś czasu',

‎apps/editor/src/views/panel/frontend/Home/Home.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ export const Home: React.FC<Props> = (props) => {
101101
<div className={styles['header__home']}>
102102
<span className="codicon codicon-home" />
103103
</div>
104-
<span className={styles['header__text']}>Home</span>
104+
<span className={styles['header__text']}>
105+
{t('panel.header.home')}
106+
</span>
105107
</div>
106108
<SettingsButton
107109
on_click={handle_settings_click}
@@ -260,6 +262,7 @@ export const Home: React.FC<Props> = (props) => {
260262
on_forward={(text) => {
261263
props.on_task_forward(text)
262264
}}
265+
placeholder={t('panel.home.tasks.placeholder')}
263266
/>
264267
)}
265268
</div>

‎packages/ui/src/components/editor/panel/Tasks/Tasks.stories.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export const Default = () => {
152152
on_add_subtask={handle_add_subtask}
153153
on_delete={handle_delete}
154154
on_forward={() => {}}
155+
placeholder="Click to add text..."
155156
/>
156157
</div>
157158
)
@@ -179,6 +180,7 @@ export const NoReorder = () => {
179180
on_add_subtask={() => {}}
180181
on_delete={() => {}}
181182
on_forward={() => {}}
183+
placeholder="Click to add text..."
182184
/>
183185
</div>
184186
)

‎packages/ui/src/components/editor/panel/Tasks/Tasks.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Props = {
2222
on_add_subtask?: (parent_task: Task) => void
2323
on_forward: (text: string) => void
2424
on_delete: (created_at: number) => void
25+
placeholder: string
2526
}
2627

2728
const add_ids = (tasks: Task[]): SortableTask[] => {
@@ -255,7 +256,7 @@ export const Tasks: React.FC<Props> = (props) => {
255256
set_editing_timestamp(params.task.created_at)
256257
}}
257258
>
258-
{params.task.text || 'Click to add text...'}
259+
{params.task.text || props.placeholder}
259260
</div>
260261
)}
261262
</div>

0 commit comments

Comments
 (0)