Skip to content

Commit

Permalink
useSpeak usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson Sousa committed Apr 5, 2024
1 parent c22f790 commit 952b994
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
8 changes: 8 additions & 0 deletions i18n/de-DE/home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"home": {
"head": {
"description": "Internationalisierung (i18n) Bibliothek zur Übersetzung von Texten, Daten und Zahlen in Qwik Apps",
"title": "{{name}} - DE"
}
}
}
8 changes: 8 additions & 0 deletions i18n/en-US/home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"home": {
"head": {
"description": "Internationalization (i18n) library to translate texts, dates and numbers in Qwik apps",
"title": "{{name}} - EN"
}
}
}
8 changes: 8 additions & 0 deletions i18n/it-IT/home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"home": {
"head": {
"description": "Libreria di internazionalizzazione (i18n) per tradurre testi, date e numeri nelle app Qwik",
"title": "{{name}} - IT"
}
}
}
6 changes: 4 additions & 2 deletions src/routes/[...lang]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
useFormatDate,
useFormatNumber,
useRelativeTime,
useSpeak,
useSpeakLocale
} from 'qwik-speak';

Expand All @@ -25,6 +26,7 @@ export const SubTitle = () => {
};

export default component$(() => {
useSpeak({ assets: ['home'] });
const t = inlineTranslate();
const p = inlinePlural();

Expand Down Expand Up @@ -83,11 +85,11 @@ export const head: DocumentHead = () => {
const t = inlineTranslate();

return {
title: t('app.head.home.title', { name: 'Qwik Speak' }),
title: t('home.head.title', { name: 'Qwik Speak' }),
meta: [
{
name: 'description',
content: t('app.head.home.description')
content: t('home.head.description')
}
],
};
Expand Down

0 comments on commit 952b994

Please sign in to comment.