Skip to content

Commit

Permalink
feat: add localization for empty posts message
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-ub committed Dec 22, 2024
1 parent fa66a0e commit fd8cc74
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/ListPosts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function getGroupName(p: InferEntrySchema<'pages'>) {
---

<ul>
{!pages.length && <div class="py2 op50">{'{ nothing here yet }'}</div>}
{!pages.length && <div class="py2 op50">{Astro.locals.t('posts.empty')}</div>}

{
pages.map(({ entry: { data }, isFallback, entryMeta }, idx) => (
Expand Down
1 change: 1 addition & 0 deletions src/schemas/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function vitesseI18nSchema() {
),

'comment.on': z.string().describe('Label for the comment section'),
'posts.empty': z.string().describe('Text shown when there are no posts to display'),
})
.partial()
}
Expand Down
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"page.draft": "This content is a draft and will not be included in production builds.",
"404.text": "Nice to meet you tho!",
"builtWithVitesse.label": "Built with Astro Vitesse",
"comment.on": "comment on"
"comment.on": "comment on",
"posts.empty": "{ nothing here yet }"
}
3 changes: 2 additions & 1 deletion src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"comment.on": "comentar en",
"expressiveCode.copyButtonCopied": "¡Copiado!",
"expressiveCode.copyButtonTooltip": "Copiar al portapapeles",
"expressiveCode.terminalWindowFallbackTitle": "Ventana de terminal"
"expressiveCode.terminalWindowFallbackTitle": "Ventana de terminal",
"posts.empty": "{ Nada aquí todavía }"
}

0 comments on commit fd8cc74

Please sign in to comment.