Commit 6c778084 authored by Matija Obreza's avatar Matija Obreza
Browse files

i18n: Use generic _ translations for common expressions

parent d861574d
......@@ -188,8 +188,8 @@ class AccessionDetailsPage extends React.Component<AccessionDetailsPageProps & W
{ details.acceUrl &&
<Property title="Accession URL" value={ details.acceUrl } index={ propertyIndex++ }/>
}
{/* {details.crop && <Property title={ t('accession.crop') } value={ details.crop.shortName } index={ propertyIndex++ }/>} */}
{ details.cropName && <Property title={ t('accession.cropName') } value={ details.cropName } index={ propertyIndex++ }/> }
{/* {details.crop && <Property title={ t(['accession.crop', '_.crop']) } value={ details.crop.shortName } index={ propertyIndex++ }/>} */}
{ details.cropName && <Property title={ t(['accession.cropName', '_.cropName']) } value={ details.cropName } index={ propertyIndex++ }/> }
{ details.taxonomy &&
<>
......@@ -303,7 +303,7 @@ class AccessionDetailsPage extends React.Component<AccessionDetailsPageProps & W
{ appConfig.accession.pdci && pdci && <PdciTable pdci={ pdci } title={ t('accession.details.pdci') }/> }
<h2 className="mt-4">{ t('accession.details.metadata') }</h2>
<Property title={ t('accession.details.uuid') } value={ `urn:uuid:${details.uuid}` } index={ propertyIndex++ }/>
<Property title={ t(['accession.details.uuid', '_.uuid']) } value={ `urn:uuid:${details.uuid}` } index={ propertyIndex++ }/>
<Property title={ t('accession.details.permanentURL') } value={
<a href={ `https://purl.org/germplasm/id/${details.uuid}` }>
{`https://purl.org/germplasm/id/${details.uuid}`}
......
......@@ -196,7 +196,7 @@ class AccessionListPage extends React.Component<AccessionListPageProps & WithTra
/>
</th>
) }
<th>{ t('accession.crop') }</th>
<th>{ t(['accession.crop', '_.crop']) }</th>
<th>{ t('accession.acceNumb') }</th>
<th>{ t('accession.accessionName') }</th>
<th>{ t('accession.taxonomy.scientificName') }</th>
......
......@@ -49,7 +49,7 @@ class AccessionOverviewSection extends React.Component<AccessionOverviewPageProp
{ overviewsTerms && overviewsTerms.get('cropName') &&
<PropertiesCard
propertiesList={ overviewsTerms.get('cropName') }
title={ t('accession.overview.cropName') }
title={ t(['accession.overview.cropName', '_.cropName']) }
propertyItemProps={ { numeric: true } }
/>
}
......
......@@ -54,7 +54,7 @@ class BrowsePage extends React.Component<OverviewPageProps & WithTranslation> {
<PageTitle title={ t('pagetitle.overview') }/>
{ overviewData ?
<>
<h1>{t('accession.overview.title')}</h1>
<h1>{t(['accession.overview.title', '_.title'])}</h1>
<p>
{ t('accession.overview.about', { count: overviewData.accessionCount, what: t('accession.model_plural', { count: overviewData.accessionCount }) }) }
</p>
......
......@@ -71,7 +71,7 @@ const DatasetDetailsPage = ({match}: DatasetDetailsPageProps) => {
{dataset.owner &&
<Property
title={t('dataset.dataProvider.title')}
title={t(['dataset.dataProvider.title', '_.title'])}
value={ dataset.owner.name }
index={propertyIndex++}
/>
......@@ -92,7 +92,7 @@ const DatasetDetailsPage = ({match}: DatasetDetailsPageProps) => {
{dataset.crops && dataset.crops.length > 0 &&
<Property
title={t('dataset.cropName')} value={ dataset.crops.join(', ') }
title={t(['dataset.cropName', '_.cropName'])} value={ dataset.crops.join(', ') }
index={propertyIndex++}
/>
}
......
......@@ -79,8 +79,8 @@ const DatasetListPage = ({location}: IDatasetListPageProps) => {
<table className="table table-striped">
<thead className="thead-dark">
<tr>
<th>{t('dataset.title')}</th>
<th>{t('dataset.crops')}</th>
<th>{t(['dataset.title', '_.title'])}</th>
<th>{t(['dataset.crops', '_.crop_plural'])}</th>
<th>{t('dataset.accessionCount')}</th>
<th>{t([ 'dataset.description', '_.description' ])}</th>
</tr>
......
{
"_": {
"description": "Description",
"title": "Title",
"uuid": "Record UUID",
"crop": "Crop",
"crop_plural": "Crops",
"cropName": "Crop name"
},
"loading": "Loading...",
"label": {
"andMore": "And {{otherMore, number}} more"
......@@ -37,8 +45,6 @@
"model_plural": "Accessions",
"historicalNote": "This is a historical record of an accession.",
"doi": "Accession DOI",
"crop": "Crop",
"cropName": "Crop name",
"acceNumb": "Accession number",
"accessionName": "Accession name",
"alias": {
......@@ -72,7 +78,6 @@
"collSite": "Collecting site",
"geo": "Georeference",
"images": "Images",
"uuid": "UUID",
"permanentURL": "Permanent URL",
"lastUpdated": "Last updated",
"created": "Created",
......@@ -97,7 +102,6 @@
"institute code": "Holding Institute",
"institute country code3": "Country of holding institute",
"crop shortName": "Crop",
"cropName": "Crop name",
"sampStat": "Biological status of accession",
"taxonomy genus": "Genus name provided to Genesys",
"taxonomy genusSpecies": "Species name provided to Genesys",
......@@ -225,17 +229,12 @@
"dataset": {
"model": "Dataset",
"model_plural": "Datasets",
"title": "Title",
"dataProvider": {
"title": "Data provider",
"name": "Data provider name",
"email": "Email",
"address": "Address"
},
"description": "Description",
"uuid": "Record UUID",
"crops": "Crops",
"cropName": "Crop name",
"traitCount": "Trait count",
"accessionCount": "Accession count",
"startDate": "Start of evaluation",
......@@ -267,12 +266,8 @@
"subset": {
"model": "Subset",
"model_plural": "Subset",
"title": "Title",
"description": "Description",
"accessionCount": "Accession count",
"source": "More information",
"uuid": "Record UUID",
"crops": "Crops",
"createDate": "Metadata create date",
"creators": "Subset creators",
"lastModified": "Metadata updated date",
......
......@@ -117,7 +117,7 @@ class CartPage extends React.Component<CartPageProps, CartPageState> {
<>
<PageTitle title={ t('pagetitle.cart') } />
<h1 className="d-flex justify-content-between align-items-center">
{ t('cart.title') }
{ t(['cart.title', '_.title']) }
{ selected.length === 0 ? (
<button type="button" className="btn btn-primary" onClick={ this.onRequest }>
{ t('cart.request') }
......
......@@ -116,7 +116,7 @@ class RequestPage extends React.Component<RequestPageProps, RequestPageState> {
return (
<>
<h1>{ t('request.title') }</h1>
<h1>{ t(['request.title', '_.title']) }</h1>
<form onSubmit={ this.onSubmit }>
<div className="form-group">
<label htmlFor="email">
......
......@@ -102,7 +102,7 @@ const SubsetDetailsPage = ({match}: SubsetDetailsPageProps) => {
{subset.crops && subset.crops.length > 0 &&
<Property
title={t('subset.crops')} value={ subset.crops.join(', ') }
title={t(['subset.crops', '_.crop_plural'])} value={ subset.crops.join(', ') }
index={propertyIndex++}
/>
}
......
......@@ -82,8 +82,8 @@ const SubsetListPage = ({location}: ISubsetListPageProps) => {
<table className="table table-striped">
<thead className="thead-dark">
<tr>
<th>{t('subset.title')}</th>
<th>{t('subset.crops')}</th>
<th>{t(['subset.title', '_.title'])}</th>
<th>{t(['subset.crops', '_.crop_plural'])}</th>
<th>{t('subset.accessionCount')}</th>
{/* <th>{t('subset.institute')}</th> */}
<th>{t([ 'subset.description', '_.description' ])}</th>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment