Skip to content

Commit

Permalink
Fix: add translations to disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
shiloholotu committed Oct 22, 2024
1 parent ac49783 commit fb1f49f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h1 id="vocabHeader">Vocabulary</h1>
</div>

<div style="height: 20vh;"></div>
<p class="disclaimer">*All translations were made by machine-translation tools.</p>
<p id="disclaimer1" class="disclaimer"></p>
</div>

<!-- CONVERSATION PAGE -->
Expand Down Expand Up @@ -163,7 +163,7 @@ <h1><span id="convoHeader"></span></h1>

<div id="selectHolder"></div>
<div style="height: 20vh;"></div>
<p class="disclaimer">*All translations were made by machine-translation tools.</p>
<p id="disclaimer1" class="disclaimer"></p>
</div>

<!-- LANGUAGE SELECT PAGE -->
Expand Down
7 changes: 7 additions & 0 deletions scripts/translate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// order: english, swahili, yoruba, igbo, hausa
const translations = {
// ui text
"choose an option":["Choose an option:","Chagua chaguo:","Yan aṣayan kan:","Họrọ nhọrọ:","Zaɓi kuma zaɓi:"],
"continue":["Continue","Endelea","Tesiwaju","Gaa n'ihu","Ci gaba"],
"complete":["Complete!","Kamili!","Pari!","Zuru oke!","Kammala!"],
Expand All @@ -7,6 +9,7 @@ const translations = {
"vocab":["Vocabulary","Msamiati","Fokabulari","Okwu","Kalmomi"],
"vocabDesc":["Learn new words and phrases!","Jifunze maneno na misemo mpya!","Kọ ẹkọ awọn ọrọ titun ati awọn gbolohun ọrọ!","Mụta okwu na akpaokwu ọhụrụ!","Koyi sababbin kalmomi da jimloli!"],
"translate":["Translate","Kutafsiri","Tumọ","Sụgharịa","Fassara"],
"disclaimer":["*Translations powered by Google Translate","*Tafsiri zinazoendeshwa na Google Tafsiri", "*Awọn itumọ ti agbara nipasẹ Google Tumọ", "*Google Translate kwadoro ntụgharị asụsụ", "*Google Translate yana ƙarfafa fassarar"],
//conversations
"Greetings!":["Greetings!","Salamu!","E Ki!","Kwuo Ndewo!","Gaisuwa!"],
"How Many Siblings?":["How Many Siblings?","Ndugu Wangapi?","Awon Arakunrin Melo Ni?","Umunne Ole?","Yan Uwa Nawa?"],
Expand Down Expand Up @@ -37,8 +40,12 @@ function translate(element, meaning, lang){
}

if(localStorage.getItem("learnLang") != null){
// translate all of the UI text
translate("convoHeader","conversations",parseInt(localStorage.getItem("knownLang")));
translate("convoDesc","convoDesc",parseInt(localStorage.getItem("knownLang")));
translate("vocabHeader","vocab",parseInt(localStorage.getItem("knownLang")));
translate("vocabDesc","vocabDesc",parseInt(localStorage.getItem("knownLang")));

translate("disclaimer1","disclaimer",parseInt(localStorage.getItem("knownLang")));
translate("disclaimer2","disclaimer",parseInt(localStorage.getItem("knownLang")));
}

0 comments on commit fb1f49f

Please sign in to comment.