-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
122 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(async function (_window, document) { | ||
const mentorsResponse = await fetch('/api/mentors').then(response => | ||
response.json(), | ||
); | ||
const mentorsAmount = mentorsResponse.resources.length; | ||
const yearsOfService = new Date().getFullYear() - 2018; | ||
|
||
const getInfoLocalizations = (mentorAmount, yearsOfService) => ({ | ||
en: { | ||
infoRing1: `${mentorAmount} mentoria`, | ||
infoRing2: `keskusteluja jo ${yearsOfService} vuotta`, | ||
}, | ||
fi: { | ||
infoRing1: `${mentorAmount} mentoria`, | ||
infoRing2: `keskusteluja jo ${yearsOfService} vuotta`, | ||
}, | ||
}); | ||
|
||
const infoLocalizations = getInfoLocalizations(mentorsAmount, yearsOfService); | ||
|
||
for (const key of ['infoRing1', 'infoRing2']) { | ||
const element = document.querySelector( | ||
`[dynamic-localization-key="${key}"]`, | ||
); | ||
let translation = infoLocalizations['fi'][key]; | ||
element.innerText = translation; | ||
} | ||
})(window, document); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"cardText": "Kohtaa ihmisiä, jotka ovat olleet samassa tilanteessa. He tietävät, mistä puhut.", | ||
"footer": "Provided by", | ||
"loginButton": "Login", | ||
"middleInfo1Heading": "Mika Ylitse?", | ||
"middleInfo1Text": "Maksuttomassa Ylitse-palvelussa SOS-Lapsikylän valmentamat mentorit auttavat sinua henkilökohtaisessa tilanteessasi luottamuksellisesti — saat apua ajasta ja paikasta riippumatta. Vertaismentori voi olla sinulle juttukaveri, opastaja, ymmärtävä kuuntelija tai sparraaja elämän erilaisissa tilanteissa.", | ||
"middleInfo2Heading": "Mista voin jutella mentorin kanssa?", | ||
"middleInfo2Text": "Voit jutella vertaismentoreiden kanssa mistä tahansa mieltäsi painavasta asiasta.", | ||
"middleInfo3Heading": "Mita jos haluan kayttaa palvelua anonyymisti", | ||
"middleInfo3Text": "Voit käyttää sovellusta nimettömästi. Valitse vain nimimerkki, josta sinua ei voi tunnistaa. Keskustelut mentoreiden kanssa ovat luottamuksellisia.", | ||
"middleInfoFooter": "Aloita palvelun kaytto rekisteroitymalla", | ||
"pageTitle": "Ylitse MentorApp", | ||
"registerButton": "Register" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"cardText": "Kohtaa ihmisiä, jotka ovat olleet samassa tilanteessa. He tietävät, mistä puhut.", | ||
"footer": "Palvelun tarjoaa", | ||
"loginButton": "Kirjaudu", | ||
"middleInfo1Heading": "Mika Ylitse?", | ||
"middleInfo1Text": "Maksuttomassa Ylitse-palvelussa SOS-Lapsikylän valmentamat mentorit auttavat sinua henkilökohtaisessa tilanteessasi luottamuksellisesti — saat apua ajasta ja paikasta riippumatta. Vertaismentori voi olla sinulle juttukaveri, opastaja, ymmärtävä kuuntelija tai sparraaja elämän erilaisissa tilanteissa.", | ||
"middleInfo2Heading": "Mista voin jutella mentorin kanssa?", | ||
"middleInfo2Text": "Voit jutella vertaismentoreiden kanssa mistä tahansa mieltäsi painavasta asiasta.", | ||
"middleInfo3Heading": "Mita jos haluan kayttaa palvelua anonyymisti", | ||
"middleInfo3Text": "Voit käyttää sovellusta nimettömästi. Valitse vain nimimerkki, josta sinua ei voi tunnistaa. Keskustelut mentoreiden kanssa ovat luottamuksellisia.", | ||
"middleInfoFooter": "Aloita palvelun kaytto rekisteroitymalla", | ||
"pageTitle": "Ylitse MentorApp", | ||
"registerButton": "Rekisteroidy" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters