Skip to content

Commit 2b6d1af

Browse files
committed
docs: add i18n for hero sponsors banner
1 parent 991795b commit 2b6d1af

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

docs/src/components/Hero.astro

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
---
22
import Default from '@astrojs/starlight/components/Hero.astro';
33
import MyIcon from './MyIcon.astro';
4-
4+
import { getEntry } from 'astro:content';
55
66
const sponsorFetch = await fetch('https://ghs.vercel.app/v2/sponsors/tomalaforge');
77
const { sponsors } = await sponsorFetch.json();
8+
9+
const { lang } = Astro.props;
10+
const { data } = await getEntry('i18n', lang);
811
---
912

1013
<div class="sponsor-header button-hover">
11-
<p>Big thanks to the people supporting this project:
14+
<p>{data['sponsors.description']}
1215
{sponsors.past.map(({username, avatar}) => (
1316
<a href=`https://github.com/${username}`>
1417
<img
@@ -23,7 +26,7 @@ const { sponsors } = await sponsorFetch.json();
2326
))}
2427
</p>
2528
<a class="action-button" href="https://github.com/sponsors/tomalaforge">
26-
<div>Join the list</div>
29+
<div>{data['sponsors.joinButton']}</div>
2730
<MyIcon name="heart" fill="none" stroke="currentColor" color="white" />
2831
</a>
2932
</div>

docs/src/content/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ const i18n = defineCollection({
6060
'subscription.note.description': z.string(),
6161
'contributor.title': z.string(),
6262
'contributor.subtitle': z.string(),
63+
'sponsors.description': z.string(),
64+
'sponsors.joinButton': z.string(),
6365
})
6466
.partial(),
6567
}),

docs/src/content/i18n/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@
2121
"subscription.note.title": "Notes",
2222
"subscription.note.description": "This email will only be used for sending new challenges updates",
2323
"contributor.title": "Contributors",
24-
"contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!"
24+
"contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!",
25+
"sponsors.description": "Big thanks to the people supporting this project: ",
26+
"sponsors.joinButton": "Join the list"
2527
}

docs/src/content/i18n/es.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,7 @@
6161
"subscription.note.title": "Notas",
6262
"subscription.note.description": "Este correo se utilizará para informar acerca de nuevos retos",
6363
"contributor.title": "Contributors",
64-
"contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!"
64+
"contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!",
65+
"sponsors.description": "Big thanks to the people supporting this project: ",
66+
"sponsors.joinButton": "Join the list"
6567
}

docs/src/content/i18n/fr.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@
2121
"subscription.note.title": "Notes",
2222
"subscription.note.description": "This email will only be used for sending new challenges updates",
2323
"contributor.title": "Contributors",
24-
"contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!"
24+
"contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!",
25+
"sponsors.description": "Big thanks to the people supporting this project: ",
26+
"sponsors.joinButton": "Join the list"
2527
}

docs/src/content/i18n/pt.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@
2222
"subscription.note.title": "Notas",
2323
"subscription.note.description": "Este email será apenas usado para enviar atualizações de novos desafios",
2424
"contributor.title": "Contributors",
25-
"contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!"
25+
"contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!",
26+
"sponsors.description": "Muito obrigado as pessoas que apoiam este projeto: ",
27+
"sponsors.joinButton": "Juntar-se à lista"
2628
}

docs/src/content/i18n/ru.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@
2222
"subscription.note.title": "Примечание",
2323
"subscription.note.description": "Этот email будет использоваться только для сообщений о новых испытаниях",
2424
"contributor.title": "Контрибьюторы",
25-
"contributor.subtitle": "Спасибо всем контрибьюторам которые помогли сделать эту документацию лучше!"
25+
"contributor.subtitle": "Спасибо всем контрибьюторам которые помогли сделать эту документацию лучше!",
26+
"sponsors.description": "Big thanks to the people supporting this project: ",
27+
"sponsors.joinButton": "Join the list"
2628
}

0 commit comments

Comments
 (0)