Skip to content

Commit

Permalink
UHF-8243: Add tschool search translations
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremysteerio committed Apr 3, 2023
1 parent a47c564 commit 4953f6e
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 21 deletions.
2 changes: 1 addition & 1 deletion dist/js/school-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/react/apps/school-search/components/ResultCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ResultCard = ({ additional_filters, address, summary_processed, name, name
cardTitle={title}
cardUrl={url?.[0] || ''}
language={language}
languageLabel={Drupal.t('Education language')}
languageLabel={Drupal.t('Language of instruction', {}, {context: 'School search: language options'})}
location={address?.[0]}
/>
);
Expand Down
8 changes: 4 additions & 4 deletions src/js/react/apps/school-search/components/ResultsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ResultsList = ({ data, error, isLoading, isValidating, page, updatePage }:
if (!data?.hits?.hits.length || error) {
return (
<div className='react-search__no-results'>
No results
{Drupal.t('No results', {}, {context: 'No search results'})}
</div>
);
}
Expand All @@ -48,7 +48,7 @@ const ResultsList = ({ data, error, isLoading, isValidating, page, updatePage }:
{!Number.isNaN(total) &&
<>
<span className='react-search__count'>{total}</span>
<span> {Drupal.t('schools', {}, {context: 'School search results statline'})}</span>
<span> {Drupal.t('schools', {}, {context: 'School search: results statline'})}</span>
</>
}
</div>
Expand All @@ -61,8 +61,8 @@ const ResultsList = ({ data, error, isLoading, isValidating, page, updatePage }:
variant='secondary'
>
{useMap ?
Drupal.t('Show schools as a list') :
Drupal.t('Show schools on map')
Drupal.t('Show schools as a list', {}, {context: 'School search: result display'}) :
Drupal.t('Show the schools on a map', {}, {context: 'School search: result display'})
}
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ const FeatureFormContainer = () => {
return (
<form className='react-search__form-container' onSubmit={onSubmit}>
<h3>
{Drupal.t('Search by school features')}
{Drupal.t('Search with school information', {}, {context: 'School search: Feature form title'})}
</h3>
<p className='react-search__form-description'>
{Drupal.t(
'You can search schools by name, language, level, or postal code. Students may be accepted into schools outside of their own district if there\'s room. Note that some schools require passing an exam.',
'You can search for a school by name, language of instruction, grade or postal code. Schools can also admit pupils that do not live in the school\'s admission area, if there are available spaces. Please note that you may have to apply to schools by taking an aptitude test.',
{},
{context: 'Feature search description'}
{context: 'School search: Feature form description'}
)}
</p>
<TextInput
className='hdbt-search__filter'
id='keyword'
label={Drupal.t('School name or postal code')}
label={Drupal.t('Name or postal code of the school', {}, {context: 'School search: Feature input label'})}
name='keyword'
onChange={({target: { value }}: { target: { value: string }}) => setKeywordValue(value)}
type='search'
Expand All @@ -66,7 +66,7 @@ const FeatureFormContainer = () => {
<div className='react-search__checkbox-filter-container'>
<fieldset className='react-search__fieldset'>
<legend className='react-search__legend'>
{Drupal.t('Education language')}
{Drupal.t('Language of instruction', {}, {context: 'School search: language options'})}
</legend>
<Checkbox
className='react-search__checkbox'
Expand All @@ -89,13 +89,13 @@ const FeatureFormContainer = () => {
</fieldset>
<fieldset className='react-search__fieldset'>
<legend className='react-search__legend'>
{Drupal.t('Education level')}
{Drupal.t('School level', {}, {context: 'School search: education level'})}
</legend>
<Checkbox
className='react-search__checkbox'
checked={stagedParams?.grades_1_6 || false}
id='grades_1_6'
label={Drupal.t('Lower levels (1-6)')}
label={Drupal.t('Primary schools (grades 1-6)', {}, {context: 'School search: education level option'})}
name='grades_1_6'
onClick={() => setStagedParams({...stagedParams, grades_1_6: !stagedParams?.grades_1_6})}
value={stagedParams?.grades_1_6?.toString() || 'false'}
Expand All @@ -104,7 +104,7 @@ const FeatureFormContainer = () => {
className='react-search__checkbox'
checked={stagedParams?.grades_7_9 || false}
id='grades_7_9'
label={Drupal.t('Upper levels (7-9)')}
label={Drupal.t('Lower secondary schools (grades 7-9)', {}, {context: 'School search: education level option'})}
name='grades_7_9'
onClick={() => setStagedParams({...stagedParams, grades_7_9: !stagedParams?.grades_7_9})}
value={stagedParams?.grades_7_9?.toString() || 'false'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ const ProximityFormContainer = () => {
return (
<form className='react-search__form-container' onSubmit={onSubmit}>
<h3>
{Drupal.t('Search by home address')}
{Drupal.t('Search for your local school', {}, {context: 'School search: local search title'})}
</h3>
<p className='react-search__form-description'>
{Drupal.t(
'You may search the primary shool choice for your child by the child\'s home address. Results are yielded from all comprehensive schools with classes 1-9. Private and national schools have their own pages.',
'Your child\'s primary comprehensive school, i.e. their local school, is determined based on the child\'s home address. The local school has a place for all local children. The search will return Finnish- and Swedish- language comprehensive schools',
{},
{context: 'Proximity search description'}
{context: 'School search: local search description'}
)}
</p>
<TextInput
className='hdbt-search__filter'
helperText={Drupal.t('Input street address')}
helperText={Drupal.t('Enter the street name and house number', {}, {context: 'School search: input helper'})}
id='keyword'
label={Drupal.t('Home address')}
label={Drupal.t('The child\'s home address', {}, {context: 'School search: input label'})}
type='search'
/>
<Button className='hdbt-search__submit-button' type='submit'>{Drupal.t('Submit')}</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ const SearchContainer = () => {
index={0}
onClick={() => setSearchMode(MODE_OPTIONS.proximity)}
>
{Drupal.t('Find nearby shools')}
{Drupal.t('Search for your local school', {}, {context: 'School search: local search title'})}
</Tab>
<Tab
className='react-search__tab'
index={1}
onClick={() => setSearchMode(MODE_OPTIONS.feature)}
>
{Drupal.t('Find by school features')}
{Drupal.t('Search with school information', {}, {context: 'School search: Feature form title'})}
</Tab>
</TabList>
</Tabs>
Expand Down
60 changes: 60 additions & 0 deletions translations/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,63 @@ msgstr "Laajenna alue: "
msgctxt "The helper text for close accordion visibility button"
msgid "Close element: "
msgstr "Sulje alue: "

msgctxt "School search: local search title"
msgid "Search for your local school"
msgstr "Etsi lähikoulua"

msgctxt "School search: local search description"
msgid "Your child's primary comprehensive school, i.e. their local school, is determined based on the child's home address. The local school has a place for all local children. The search will return Finnish- and Swedish- language comprehensive schools"
msgstr "Lapsen ensisijainen peruskoulu, eli lähikoulu, määräytyy lapsen kotiosoitteen mukaan. Lähikoulussa on paikka kaikille lapsille. Hausta löytyvät suomen- ja ruotsinkieliset peruskoulut."

msgctxt "School search: input helper"
msgid "Enter the street name and house number"
msgstr "Kirjoita kadunnimi ja talonumero"

msgctxt "School search: input label"
msgid "The child's home address"
msgstr "Lapsen kotiosoite"

msgctxt "School search: results statline"
msgid "schools"
msgstr "koulua"

msgctxt "School search: result display"
msgid "Show the schools on a map"
msgstr "Näytä koulut kartalla"

msgctxt "School search: result display"
msgid "Show schools as a list"
msgstr "Näytä koulut listana"

msgctxt "School search: language options"
msgid "Language of instruction"
msgstr "Opetuskieli"

msgctxt "School search: Feature form title"
msgid "Search with school information"
msgstr "Etsi koulun tiedoilla"

msgctxt "School search: Feature form description"
msgid "You can search for a school by name, language of instruction, grade or postal code. Schools can also admit pupils that do not live in the school's admission area, if there are available spaces. Please note that you may have to apply to schools by taking an aptitude test."
msgstr "Voit etsiä koulua nimen, opetuskielen, luokka-asteen tai postinumeron mukaan. Kouluihin voidaan ottaa myös muita kuin oman oppilaaksiottoalueen oppilaita, mikäli siellä on tilaa. Huomaa, että kouluihin voi joutua hakemaan valintakokeen kautta."

msgctxt "School search: education level"
msgid "School level"
msgstr "Kouluaste"

msgctxt "School search: Feature input label"
msgid "Name or postal code of the school"
msgstr "Koulun nimi tai postinumero"

msgctxt "No search results"
msgid "No results"
msgstr "Ei tuloksia"

msgctxt "School search: education level option"
msgid "Primary schools (grades 1-6)"
msgstr "Alakoulut (luokat 1-6)"

msgctxt "School search: education level option"
msgid "Lower secondary schools (grades 7-9)"
msgstr "Yläkoulut (luokat 7-9)"
60 changes: 60 additions & 0 deletions translations/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,63 @@ msgstr "Expandera elementet: "
msgctxt "The helper text for close accordion visibility button"
msgid "Close element: "
msgstr "Stäng elementet: "

msgctxt "School search: local search title"
msgid "Search for your local school"
msgstr "Sök närskola"

msgctxt "School search: local search description"
msgid "Your child's primary comprehensive school, i.e. their local school, is determined based on the child's home address. The local school has a place for all local children. The search will return Finnish- and Swedish- language comprehensive schools"
msgstr "Barnets primära grundskola, dvs. närskolan, bestäms enligt barnets hemadress. I närskolan finns en plats föralla barn. I sökningen finns finsk- ja svenskspråkiga grundskolor."

msgctxt "School search: input helper"
msgid "Enter the street name and house number"
msgstr "Fyll i gatuadress och husnummer"

msgctxt "School search: input label"
msgid "The child's home address"
msgstr "Barnets hemadress"

msgctxt "School search: results statline"
msgid "schools"
msgstr "skolor"

msgctxt "School search: result display"
msgid "Show the schools on a map"
msgstr "Visa skolorna på kartan"

msgctxt "School search: result display"
msgid "Show schools as a list"
msgstr "Visa skolorna som en lista"

msgctxt "School search: language options"
msgid "Language of instruction"
msgstr "Undervisningsspråk"

msgctxt "School search: Feature form title"
msgid "Search with school information"
msgstr "Sök på skolans uppgifter"

msgctxt "School search: Feature form description"
msgid "You can search for a school by name, language of instruction, grade or postal code. Schools can also admit pupils that do not live in the school's admission area, if there are available spaces. Please note that you may have to apply to schools by taking an aptitude test."
msgstr "Du kan söka skola på namn, undervisningsspråk, årskurs eller postnummer. Skolorna kan också ta emot andra elever än de som bor inom det egna elevupptagningsområdet, om det finns plats. Observera att man kan bli tvungen att söka till skolorna via inträdesprov."

msgctxt "School search: education level"
msgid "School level'"
msgstr "Skolstadium"

msgctxt "School search: Feature input label"
msgid "Name or postal code of the school"
msgstr "Skolans namn eller postnummer"

msgctxt "No search results"
msgid "No results"
msgstr "Inga resultat"

msgctxt "School search: education level option"
msgid "Primary schools (grades 1-6)"
msgstr "Grundskolor (år 1-6)"

msgctxt "School search: education level option"
msgid "Lower secondary schools (grades 7-9)"
msgstr "Grundskolor (år 7-9)"

0 comments on commit 4953f6e

Please sign in to comment.