Skip to content

Commit

Permalink
feat: added first paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
iamwacko committed May 3, 2023
1 parent 8bc6e29 commit b52a1e0
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .typesafe-i18n.json
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 3 additions & 2 deletions src/i18n/de/index.ts
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion src/i18n/eo/index.ts
Original file line number Diff line number Diff line change
@@ -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
28 changes: 17 additions & 11 deletions src/i18n/i18n-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,22 @@ export type BaseLocale = 'en'
export type Locales =
| 'de'
| 'en'
| 'it'
| 'eo'
| 'it'

export type Translation = RootTranslation

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
Expand All @@ -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}}
*/
Expand All @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/i18n-util.async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
}

Expand Down
2 changes: 2 additions & 0 deletions src/i18n/i18n-util.sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
1 change: 1 addition & 0 deletions src/i18n/i18n-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const baseLocale: Locales = 'en'
export const locales: Locales[] = [
'de',
'en',
'eo',
'it'
]

Expand Down
3 changes: 2 additions & 1 deletion src/i18n/it/index.ts
Original file line number Diff line number Diff line change
@@ -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
8 changes: 5 additions & 3 deletions src/routes/[lang=lang]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
</script>

<h2>
{$LL.welcome({ year: 2021 })}
{$LL.welcome}
</h2>

<h3>
{$LL.summit.schedule(day)}
{$LL.summit.schedule}
</h3>

<img src=/rajavauni.avif alt="Rojava University">
<img src=/rajavauni.avif alt="Rojava University">

<p>{$LL.first_paragraph}</p>
2 changes: 1 addition & 1 deletion src/routes/[lang=lang]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit b52a1e0

Please sign in to comment.