From b52a1e0a52e2480ba735e420e78ebcff369a3558 Mon Sep 17 00:00:00 2001 From: s e Date: Wed, 3 May 2023 19:00:24 +0000 Subject: [PATCH] feat: added first paragraph --- .typesafe-i18n.json | 2 +- src/i18n/de/index.ts | 5 +++-- src/i18n/en/index.ts | 3 ++- src/i18n/eo/index.ts | 3 ++- src/i18n/i18n-types.ts | 28 +++++++++++++++++----------- src/i18n/i18n-util.async.ts | 1 + src/i18n/i18n-util.sync.ts | 2 ++ src/i18n/i18n-util.ts | 1 + src/i18n/it/index.ts | 3 ++- src/routes/[lang=lang]/+page.svelte | 8 +++++--- src/routes/[lang=lang]/+page.ts | 2 +- 11 files changed, 37 insertions(+), 21 deletions(-) diff --git a/.typesafe-i18n.json b/.typesafe-i18n.json index 929bbe3..f9cc85b 100644 --- a/.typesafe-i18n.json +++ b/.typesafe-i18n.json @@ -1,4 +1,4 @@ { - "$schema": "https://unpkg.com/typesafe-i18n@5.24.2/schema/typesafe-i18n.json", + "$schema": "https://unpkg.com/typesafe-i18n@5.24.3/schema/typesafe-i18n.json", "adapter": "svelte" } \ No newline at end of file diff --git a/src/i18n/de/index.ts b/src/i18n/de/index.ts index ef681ac..9d01068 100644 --- a/src/i18n/de/index.ts +++ b/src/i18n/de/index.ts @@ -1,13 +1,14 @@ import type { Translation } from '../i18n-types' const de: Translation = { - title: 'typesafe-i18n - Svelte Herbst Summit {year}', - welcome: 'Willkommen zum Svelte Herbst Summit {year}', + title: 'Bildung vor Ort', + welcome: 'Bildung vor Ort', spectators: '{0} Zuschauer live', summit: { schedule: '{0|simpleDate}', }, log: `Dieses Logging wurde von '{fileName}' aufgerufen`, + first_paragraph: 'Wir können lokal arbeiten, um die Bevölkerung aufzuklären, indem wir uns auf die Gemeinschaft konzentrieren. In Rojava und Chiapas ist dies bereits teilweise und mit großem Erfolg geschehen. Rojava ist der am besten ausgebildete Teil Syriens und die EZLN-Schulen schneiden besser ab als andere Schulen in der Region. Dies kann wichtige Auswirkungen haben, da die Bildung der Menschen für eine gut funktionierende Gesellschaft wichtig ist.', } export default de diff --git a/src/i18n/en/index.ts b/src/i18n/en/index.ts index f4ea36c..25756ff 100644 --- a/src/i18n/en/index.ts +++ b/src/i18n/en/index.ts @@ -2,12 +2,13 @@ import type { BaseTranslation } from '../i18n-types' const en: BaseTranslation = { title: 'Educating Locally', - welcome: 'Welcome to Svelte Fall Summit {year:number}', + welcome: 'Educating Locally', spectators: '{0} live spectator{{s}}', summit: { schedule: '{0:Date|simpleDate}', }, log: `This log was called from '{fileName:string}'`, + first_paragraph: `We can work locally to educate the population by focusing on community. In Rojava and Chiapas this has already been done to some degree, to much success. Rojava is the most educated part of Syria and EZLN schools fare better than other schools in the area. This can have important impacts, as the education of the people is important to a properly running society.`, } export default en diff --git a/src/i18n/eo/index.ts b/src/i18n/eo/index.ts index 3132c89..d6097d9 100644 --- a/src/i18n/eo/index.ts +++ b/src/i18n/eo/index.ts @@ -1,13 +1,14 @@ import type { BaseTranslation } from '../i18n-types' const en: BaseTranslation = { - title: 'typesafe-i18n - Svelte Fall Summit {year:number}', + title: 'eduki loke', welcome: 'Welcome to Svelte Fall Summit {year:number}', spectators: '{0} live spectator{{s}}', summit: { schedule: '{0:Date|simpleDate}', }, log: `This log was called from '{fileName:string}'`, + first_paragraph: 'Ni povas labori loke por eduki la loĝantaron per fokuso sur komunumo. En Rojava kaj Chiapas tio jam estis farita iagrade, kun multe da sukceso. Rojava estas la plej klera parto de Sirio kaj EZLN-lernejoj fartas pli bone ol aliaj lernejoj en la areo. Ĉi tio povas havi gravajn efikojn, ĉar la edukado de la homoj estas grava por taŭge funkcianta socio.', } export default en diff --git a/src/i18n/i18n-types.ts b/src/i18n/i18n-types.ts index 5727f80..72c9c6e 100644 --- a/src/i18n/i18n-types.ts +++ b/src/i18n/i18n-types.ts @@ -8,8 +8,8 @@ export type BaseLocale = 'en' export type Locales = | 'de' | 'en' - | 'it' | 'eo' + | 'it' export type Translation = RootTranslation @@ -17,15 +17,13 @@ export type Translations = RootTranslation type RootTranslation = { /** - * t​y​p​e​s​a​f​e​-​i​1​8​n​ ​-​ ​S​v​e​l​t​e​ ​F​a​l​l​ ​S​u​m​m​i​t​ ​{​y​e​a​r​} - * @param {number} year + * E​d​u​c​a​t​i​n​g​ ​L​o​c​a​l​l​y */ - title: RequiredParams<'year'> + title: string /** - * W​e​l​c​o​m​e​ ​t​o​ ​S​v​e​l​t​e​ ​F​a​l​l​ ​S​u​m​m​i​t​ ​{​y​e​a​r​} - * @param {number} year + * E​d​u​c​a​t​i​n​g​ ​L​o​c​a​l​l​y */ - welcome: RequiredParams<'year'> + welcome: string /** * {​0​}​ ​l​i​v​e​ ​s​p​e​c​t​a​t​o​r​{​{​s​}​} * @param {string | number | boolean} 0 @@ -43,17 +41,21 @@ type RootTranslation = { * @param {string} fileName */ log: RequiredParams<'fileName'> + /** + * W​e​ ​c​a​n​ ​w​o​r​k​ ​l​o​c​a​l​l​y​ ​t​o​ ​e​d​u​c​a​t​e​ ​t​h​e​ ​p​o​p​u​l​a​t​i​o​n​ ​b​y​ ​f​o​c​u​s​i​n​g​ ​o​n​ ​c​o​m​m​u​n​i​t​y​.​ ​I​n​ ​R​o​j​a​v​a​ ​a​n​d​ ​C​h​i​a​p​a​s​ ​t​h​i​s​ ​h​a​s​ ​a​l​r​e​a​d​y​ ​b​e​e​n​ ​d​o​n​e​ ​t​o​ ​s​o​m​e​ ​d​e​g​r​e​e​,​ ​t​o​ ​m​u​c​h​ ​s​u​c​c​e​s​s​.​ ​R​o​j​a​v​a​ ​i​s​ ​t​h​e​ ​m​o​s​t​ ​e​d​u​c​a​t​e​d​ ​p​a​r​t​ ​o​f​ ​S​y​r​i​a​ ​a​n​d​ ​E​Z​L​N​ ​s​c​h​o​o​l​s​ ​f​a​r​e​ ​b​e​t​t​e​r​ ​t​h​a​n​ ​o​t​h​e​r​ ​s​c​h​o​o​l​s​ ​i​n​ ​t​h​e​ ​a​r​e​a​.​ ​T​h​i​s​ ​c​a​n​ ​h​a​v​e​ ​i​m​p​o​r​t​a​n​t​ ​i​m​p​a​c​t​s​,​ ​a​s​ ​t​h​e​ ​e​d​u​c​a​t​i​o​n​ ​o​f​ ​t​h​e​ ​p​e​o​p​l​e​ ​i​s​ ​i​m​p​o​r​t​a​n​t​ ​t​o​ ​a​ ​p​r​o​p​e​r​l​y​ ​r​u​n​n​i​n​g​ ​s​o​c​i​e​t​y​. + */ + first_paragraph: string } export type TranslationFunctions = { /** - * typesafe-i18n - Svelte Fall Summit {year} + * Educating Locally */ - title: (arg: { year: number }) => LocalizedString + title: () => LocalizedString /** - * Welcome to Svelte Fall Summit {year} + * Educating Locally */ - welcome: (arg: { year: number }) => LocalizedString + welcome: () => LocalizedString /** * {0} live spectator{{s}} */ @@ -68,6 +70,10 @@ export type TranslationFunctions = { * This log was called from '{fileName}' */ log: (arg: { fileName: string }) => LocalizedString + /** + * We can work locally to educate the population by focusing on community. In Rojava and Chiapas this has already been done to some degree, to much success. Rojava is the most educated part of Syria and EZLN schools fare better than other schools in the area. This can have important impacts, as the education of the people is important to a properly running society. + */ + first_paragraph: () => LocalizedString } export type Formatters = { diff --git a/src/i18n/i18n-util.async.ts b/src/i18n/i18n-util.async.ts index 8ea5971..2db1768 100644 --- a/src/i18n/i18n-util.async.ts +++ b/src/i18n/i18n-util.async.ts @@ -8,6 +8,7 @@ import { loadedFormatters, loadedLocales, locales } from './i18n-util' const localeTranslationLoaders = { de: () => import('./de'), en: () => import('./en'), + eo: () => import('./eo'), it: () => import('./it'), } diff --git a/src/i18n/i18n-util.sync.ts b/src/i18n/i18n-util.sync.ts index 4b8472f..44e1f2e 100644 --- a/src/i18n/i18n-util.sync.ts +++ b/src/i18n/i18n-util.sync.ts @@ -7,11 +7,13 @@ import { loadedFormatters, loadedLocales, locales } from './i18n-util' import de from './de' import en from './en' +import eo from './eo' import it from './it' const localeTranslations = { de, en, + eo, it, } diff --git a/src/i18n/i18n-util.ts b/src/i18n/i18n-util.ts index 45c6935..9e7683b 100644 --- a/src/i18n/i18n-util.ts +++ b/src/i18n/i18n-util.ts @@ -13,6 +13,7 @@ export const baseLocale: Locales = 'en' export const locales: Locales[] = [ 'de', 'en', + 'eo', 'it' ] diff --git a/src/i18n/it/index.ts b/src/i18n/it/index.ts index af64d2e..6281200 100644 --- a/src/i18n/it/index.ts +++ b/src/i18n/it/index.ts @@ -1,13 +1,14 @@ import type { Translation } from '../i18n-types' const it: Translation = { - title: 'typesafe-i18n - Svelte Summit Autunno {year}', + title: 'educare a livello locale', welcome: 'Benvenuti al Svelte Summit Autunno {year}', spectators: '{0} {{spettatore|spettatori}} in diretta', summit: { schedule: '{0|simpleDate}', }, log: `Questa protocollazione è stata chiamata da '{fileName}'`, + first_paragraph: 'Ni povas labori loke por eduki la loĝantaron per fokuso sur komunumo. En Rojava kaj Chiapas tio jam estis farita iagrade, kun multe da sukceso. Rojava estas la plej klera parto de Sirio kaj EZLN-lernejoj fartas pli bone ol aliaj lernejoj en la areo. Ĉi tio povas havi gravajn efikojn, ĉar la edukado de la homoj estas grava por taŭge funkcianta socio.', } export default it diff --git a/src/routes/[lang=lang]/+page.svelte b/src/routes/[lang=lang]/+page.svelte index af33f5f..bee0179 100644 --- a/src/routes/[lang=lang]/+page.svelte +++ b/src/routes/[lang=lang]/+page.svelte @@ -24,11 +24,13 @@

- {$LL.welcome({ year: 2021 })} + {$LL.welcome}

- {$LL.summit.schedule(day)} + {$LL.summit.schedule}

-Rojava University \ No newline at end of file +Rojava University + +

{$LL.first_paragraph}

\ No newline at end of file diff --git a/src/routes/[lang=lang]/+page.ts b/src/routes/[lang=lang]/+page.ts index 91c115a..2424201 100644 --- a/src/routes/[lang=lang]/+page.ts +++ b/src/routes/[lang=lang]/+page.ts @@ -13,6 +13,6 @@ export const load: PageLoad = async ({ parent }) => { const $LL = get(LL) console.info($LL.log({ fileName: '+page.ts' })) return { - title: $LL.title({ year: 2021 }), + title: $LL.title, } }