Skip to content

Commit

Permalink
update localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
hj940709 committed Mar 13, 2024
1 parent 3a115ae commit 7935082
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 78 deletions.
73 changes: 42 additions & 31 deletions client/components/HomeView/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState, useEffect } from 'react'
import { useHistory } from 'react-router'
import { FormattedMessage } from 'react-intl'
import { FormattedMessage, useIntl } from 'react-intl'
import { images, hiddenFeatures, supportedLearningLanguages } from 'Utilities/common'
import { useDispatch, useSelector } from 'react-redux'
import { getGroups } from 'Utilities/redux/groupsReducer'
import { getAllStories } from 'Utilities/redux/storiesReducer'
import { openEncouragement } from 'Utilities/redux/encouragementsReducer'
import { Button } from 'react-bootstrap'
import { Popup } from 'semantic-ui-react'
import useWindowDimensions from 'Utilities/windowDimensions'
import Footer from 'Components/Footer'
import AddStoryModal from 'Components/AddStoryModal'
Expand All @@ -28,27 +28,43 @@ const HomeviewButton = ({
dataCy,
wide,
beta_feature,
content=null
}) => {
return (
const intl = useIntl()
const button = (
<button
className={`flex justify-center homeview-btn${wide ? ' homeview-btn-wide' : ' homeview-btn-narrow'}`}
type="button"
onClick={handleClick}
data-cy={dataCy}
className={`flex justify-center homeview-btn${wide ? ' homeview-btn-wide' : ' homeview-btn-narrow'}`}
type="button"
onClick={handleClick}
data-cy={dataCy}
>
{!wide && <img src={imgSrc} alt={altText} style={{ maxWidth: '50px', maxHeight: '50px' }}/>}
<div
className="homeview-btn-text flex items-center justify-center"
style={{ width: '100%', height: '100%', alignItems: 'center'}}
>
{!wide && <img src={imgSrc} alt={altText} style={{ maxWidth: '50px', maxHeight: '50px' }}/>}
<div
className="homeview-btn-text flex items-center justify-center"
style={{ width: '100%', height: '100%', alignItems: 'center'}}
>
<FormattedMessage id={translationKey} />
{beta_feature && (
<sup>
<b style={{ color: 'red' }}>BETA</b>
</sup>
)}
</div>
</button>
<FormattedMessage id={translationKey} />
{beta_feature && (
<sup>
<b style={{ color: 'red' }}>BETA</b>
</sup>
)}
</div>
</button>
)
return (
<>
{content && <Popup
position="top center"
trigger={button}
content={intl.formatMessage({id: content})}
basic
/> || button
}
</>



)
}

Expand Down Expand Up @@ -126,6 +142,7 @@ const HomeviewButtons = ({
translationKey="Library"
handleClick={() => history.push('/library')}
dataCy="library-button"
content="Home-Library-EXPLANATION"
/>
</div>
<div className="lesson-btn-cont tour-lesson">
Expand All @@ -135,6 +152,7 @@ const HomeviewButtons = ({
translationKey="lesson-home-btn"
beta_feature={true}
handleClick={() => history.push('/lessons/library')}
content="Home-Lessons-EXPLANATION"
/>
</div>
</div>
Expand All @@ -150,6 +168,7 @@ const HomeviewButtons = ({
translationKey="continue-activity"
handleClick={() => history.push(activityLink)}
dataCy="continue-activity-button"
content="Home-Continue-Activity-EXPLANATION"
/>
</div>
)}
Expand All @@ -162,6 +181,7 @@ const HomeviewButtons = ({
translationKey="practice-now"
handleClick={() => setPracticeModalOpen(true)}
dataCy="practice-now"
content="Home-Dive-In-EXPLANATION"
/>
</div>
<div className="lesson-btn-cont tour-lesson">
Expand All @@ -171,6 +191,7 @@ const HomeviewButtons = ({
translationKey="lesson-home-btn"
beta_feature={true}
handleClick={() => history.push('/lessons/library')}
content="Home-Lessons-EXPLANATION"
/>
</div>
<div className="flashcards-btn-cont tour-flashcards">
Expand All @@ -179,19 +200,9 @@ const HomeviewButtons = ({
altText="three playing cards"
translationKey="Flashcards"
handleClick={() => history.push('/flashcards')}
content="Home-Flashcards-EXPLANATION"
/>
</div>

{hasAdaptiveTests && (
<div className="adaptive-test-btn-cont">
<HomeviewButton
imgSrc={images.adaptiveTest}
altText="a test form with a star on it"
translationKey="adaptive-test"
handleClick={() => history.push('/adaptive-test')}
/>
</div>
)}
{hasTests && aTestIsEnabled && (
<div className="test-btn-cont">
<HomeviewButton
Expand Down
31 changes: 22 additions & 9 deletions client/components/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,16 @@ export default function Sidebar({ history }) {
<FormattedMessage id="Flashcards" />
</Button>
</Link>

<Link to="/adaptive-test">
<Button
variant="secondary"
style={{ marginTop: marginTopButton }}
block
>
<Icon size="small" name="file alternate outline" bordered />{' '}
<FormattedMessage id="adaptive-test" />
</Button>
</Link>
{hiddenFeatures && (
<>
<Link to="/test-construction">
Expand Down Expand Up @@ -270,16 +279,20 @@ export default function Sidebar({ history }) {
}}
>
<Menu.Item style={{ paddingBottom: '0px' }}>
<Dropdown item text='More'>
<Link to="/profile/settings">
<Button
variant="secondary"
style={{ marginBottom: marginTopButton }}
block
data-cy="navbar-settings-button"
>
<Icon size="small" name="settings" bordered />{' '}
<FormattedMessage id="Settings" />
</Button>
</Link>
<Dropdown item text='More' >
<DropdownMenu style={{minHeight: '18.5em'}}>
<DropdownItem text={intl.formatMessage({id: 'groups'})} icon='group' as={Link} to={isTeacher ? '/groups/teacher' : '/groups/student'}/>
<DropdownItem
text={intl.formatMessage({id: 'Settings'})}
icon='settings'
as={Link}
to={'/profile/settings'}
data-cy="navbar-settings-button"
/>
<DropdownItem as={Link} to="/profile/main" text={intl.formatMessage({id: 'Profile'})} icon="user outline" />
{learningLanguage && (
<DropdownItem
Expand Down
10 changes: 8 additions & 2 deletions client/util/translations/revita/en/LC_MESSAGES/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,12 @@
"control-end-of-set-open-ended-question-c": "What kind of help would you wish for?",
"elicitation-construct-specific-details-NOT-USED": "I can’t find the right place in the text",
"elicitation-construct-deducing-vocabulary-NOT-USED": "I don’t understand the meaning of some words",
"confirm-next-set": "Confirm",
"continue-activity": "Continue your activity"
"confirm-next-set": "OK",
"continue-activity": "Continue previous activity",
"Home-Continue-Activity-EXPLANATION": "Click here to resume where you left off in the previous session",
"Home-Dive-In-EXPLANATION": "Here Revita will suggest texts for you to practice with, based on your preferences",
"Home-Lessons-EXPLANATION": "Here you will get lessons on many grammar topics, based on many examples selected from various stories.",
"Home-Adaptive-Test-EXPLANATION": "Here you can take a quick test — about 50-60 questions — which will produce an estimate of your level of knowledge",
"Home-Flashcards-EXPLANATION": "Here you can play with flashcards — to improve your knowledge of vocabulary",
"Home-Library-EXPLANATION": "Here is the library of all texts uploaded so far: your own, those uploaded by your teacher, and a small common collection"
}
9 changes: 8 additions & 1 deletion client/util/translations/revita/fi/LC_MESSAGES/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1574,5 +1574,12 @@
"control-end-of-set-open-ended-question-c": "Millaista apua toivoisit?",
"elicitation-construct-specific-details-NOT-USED": "En löydä tekstistä oikeaa kohtaa",
"elicitation-construct-deducing-vocabulary-NOT-USED": "Joidenkin sanojen merkitystä en ymmärrä",
"confirm-next-set": "Confirm"
"confirm-next-set": "OK",
"continue-activity": "Jatka aiempaa toimintaani",
"Home-Continue-Activity-EXPLANATION": "Napsauta tätä jatkaaksesi siitä, mihin jäit edellisessä istunnossa",
"Home-Dive-In-EXPLANATION": "Täällä Revita ehdottaa tekstejä harjoitteluun mieltymystesi perusteella",
"Home-Lessons-EXPLANATION": "Täältä saat oppitunteja monista kieliopin aiheista, jotka perustuvat moniin erilaisista teksteistä valittuihin esimerkkeihin",
"Home-Adaptive-Test-EXPLANATION": "Täällä voit suorittaa lyhyen testin – noin 50–60 kysymystä – joka tuottaa arvion tietotasostasi",
"Home-Flashcards-EXPLANATION": "Täällä voit pelata muistikorteilla parantaaksesi sanavarastotietoasi",
"Home-Library-EXPLANATION": "Tässä on kirjasto kaikista tähän mennessä ladatuista teksteistä: omasi, opettajasi lataamat tekstit, ja pieni yhteinen kokoelma"
}
11 changes: 9 additions & 2 deletions client/util/translations/revita/it/LC_MESSAGES/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@
"encouragements-default-3": "Ben fatto!",
"enc-grammar-progress-1": "Vuoi rivedere i tuoi progressi sulla",
"enc-grammar-progress-2": "grammatica",
"no-hints-available": "Nessun indizio per questa",
"no-hints-available": "Spiacenti, nessun suggerimento disponibile",
"user-settings-options": "Impostazione utente",
"annotation-name": "Nome della nota (opzionale)",
"story-top-topics": "Praticare con questa storia ti aiuta di superare questi soggetti",
Expand Down Expand Up @@ -1573,5 +1573,12 @@
"control-end-of-set-open-ended-question-c": "Che tipo di aiuto vorresti?",
"elicitation-construct-specific-details-NOT-USED": "Non trovо il posto giusto nel testo",
"elicitation-construct-deducing-vocabulary-NOT-USED": "Non capisco il senso di alcune parole",
"confirm-next-set": "Confirm"
"confirm-next-set": "OK",
"continue-activity": "Continua attività precedente",
"Home-Continue-Activity-EXPLANATION": "Clicca qui per riprendere da dove avevi interrotto nella sessione precedente",
"Home-Dive-In-EXPLANATION": "Qui Revita ti suggerirà i testi con cui esercitarti, in base alle tue preferenze",
"Home-Lessons-EXPLANATION": "Qui riceverai lezioni su molti argomenti di grammatica, sulla base di molti esempi selezionati da varie storie",
"Home-Adaptive-Test-EXPLANATION": "Qui puoi sostenere un breve test - 50-60 domande - che produrrà una stima del tuo livello di conoscenza",
"Home-Flashcards-EXPLANATION": "Qui puoi giocare con le flashcard per migliorare la tua conoscenza del vocabolario",
"Home-Library-EXPLANATION": "Qui la libreria di tutti i testi caricati finora: i tuoi, quelli caricati dal tuo insegnante, e una raccolta comune"
}
13 changes: 10 additions & 3 deletions client/util/translations/revita/ru/LC_MESSAGES/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@
"tour-step9-HELP-message": "Пожалуйста, посмотри через эту кнопку:\n<ul>\n<li/>вводное видео,\n<li/>подробные инструкции,\n<li/>FAQ &mdash; часто задаваемые вопросы</ul>",
"streak-done": "Ты в ударном режиме: <b>{daysStreaked}</b> дней!",
"streak-undone": "Продолжай работать в ударном режиме!",
"streak-broken": "Ударный режим прервался!",
"streak-broken": "Ударный режим прерван!",
"continue-streak": "Продолжай работу в ударном режиме",
"start-streak": "Вернуться в ударный режим",
"do-snippets": "Выполни упражнения в 10-и фрагментах из текста",
Expand Down Expand Up @@ -1566,7 +1566,7 @@
"move-to-next-set-of-reading-items": "Теперь переходим к следующему набору заданий. Они немного отличаются от предыдущих.",
"experimental-after-first-mediation-slider-question": "Насколько полезен был этот отзыв?",
"experimental-after-first-mediation-open-ended-question": "Изменила ли обратная связь твой подход к задаче? Как?",
"experimental-after-last-item-slider-question": "Насколько полезной кажется эта обратная связь, после выполнения этих задач?",
"experimental-after-last-item-slider-question": "Насколько полезной кажется эта обратная связь после выполнения этих задач?",
"experimental-end-of-set-open-ended-question-a": "Повлияла ли обратная связь в предыдущих пунктах на то, как ты читаешь тексты?",
"experimental-end-of-set-open-ended-question-b": "Появились ли у тебя новые идеи о том, как отвечать на вопросы по чтению?",
"experimental-end-of-set-open-ended-question-c": "Что бы ты изменил/а в упражнениях, чтобы их было легче использовать?",
Expand All @@ -1576,5 +1576,12 @@
"control-end-of-set-open-ended-question-c": "Какую помощь ты бы хотел получить?",
"elicitation-construct-specific-details-NOT-USED": "Не могу найти нужное место в тексте",
"elicitation-construct-deducing-vocabulary-NOT-USED": "Не понимаю значения некоторых слов",
"confirm-next-set": "Confirm"
"confirm-next-set": "OK",
"continue-activity": "Продолжить предыдущие упражнения",
"Home-Continue-Activity-EXPLANATION": "Нажми здесь, чтобы продолжить упражнения из твоей предыдущей сессии",
"Home-Dive-In-EXPLANATION": "Здесь Revita предложит тебе тексты для практики в зависимости от твоих предпочтений",
"Home-Lessons-EXPLANATION": "Здесь ты получишь уроки по грамматическим темам, основанные на примерах, выбранных из различных текстов.",
"Home-Adaptive-Test-EXPLANATION": "Здесь ты можешь пройти небольшой тест (50-60 вопросов), который позволит оценить твой уровень знаний",
"Home-Flashcards-EXPLANATION": "Здесь ты можешь поработать с карточками — чтобы увеличить свой словарный запас",
"Home-Library-EXPLANATION": "Здесь библиотека загруженных на данный момент текстов: твои собственные, загруженные твоим учителем и небольшая общая коллекция"
}
Loading

0 comments on commit 7935082

Please sign in to comment.