Skip to content

Commit

Permalink
fix/filter-label: Add remaining translations
Browse files Browse the repository at this point in the history
  • Loading branch information
roshni73 committed Apr 25, 2024
1 parent 6d63bc7 commit f64f56a
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/components/GlobalFooter/i18n.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"namespace": "common",
"strings": {
"strings":{
"footerAboutAlertHub":"About Alert Hub",
"footerAboutAlertHubDesc":"The aim of IFRC Alert Hub is to provide timely and effective emergency alerts to communities worldwide, empowering them to protect their lives and livelihoods.",
"footerFindOutMore":"Find out more",
Expand Down
1 change: 1 addition & 0 deletions src/views/About/i18n.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "about",
"strings": {
"aboutAlertHubTitle":"AlertHub - About",
"aboutTheGoalTitile": "The Goal",
"aboutGoalDescription":"The goal of the IFRC Alert Hub is to ensure that communities everywhere receive the most timely and effective emergency alerting possible, and can thereby take action to safeguard their lives and livelihoods.",
"aboutimage":"",
Expand Down
2 changes: 1 addition & 1 deletion src/views/About/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function Component() {

return (
<Page
title="AlertHub - About"
title={strings.aboutAlertHubTitle}
className={styles.about}
beforeHeaderContent={(
<div className={styles.headerContainer}>
Expand Down
1 change: 1 addition & 0 deletions src/views/AlertDetails/AlertInfo/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"alertInfoAreaDescription": "Area Description",
"alertInfoDescription": "Description",
"alertInfoInstruction": "Instruction",
"alertInfoAffectedArea":"Affected areas",
"alertInfoCategory": "Category",
"alertInfoResponseType": "Response Type",
"alertInfoAudience": "Audience",
Expand Down
3 changes: 1 addition & 2 deletions src/views/AlertDetails/AlertInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ function AlertInfo(props: Props) {
</Container>
)}
<Container
// FIXME: use strings
heading="Affected areas"
heading={strings.alertInfoAffectedArea}
empty={isNotDefined(data) || data.areas.length === 0}
contentViewType="grid"
numPreferredGridContentColumns={5}
Expand Down
15 changes: 14 additions & 1 deletion src/views/AlertDetails/AlertMetadata/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@
"namespace": "countryAlertInfo",
"strings": {
"countryAlertInfoTitle":"Alert",
"notAvailable": "Not Available"
"notAvailable": "Not Available",
"alertMetaDataMessageType":"Message Type",
"alertMetaDataSentBy":"Sent By",
"alertMetaDataSentOn":"Sent On",
"alertMetaDataSource":"Source",
"alertMetaDataScope":"Scope",
"alertMetaDataRestriction":"Restriction",
"alertMetaDataAddresses":"Addresses",
"alertMetaDataHandlingCode":"Handling Code",
"alertMetaDataNote": "Note",
"alertMetaDataIncidentIds":"Incident IDs",
"alertMetaDataURL":"URL",
"alertMetaDataReferences":"References"
}

}

29 changes: 14 additions & 15 deletions src/views/AlertDetails/AlertMetadata/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import styles from './styles.module.css';
interface ReferenceOutputProps {
referenceStr?: string;
}

function ReferenceOutput(props: ReferenceOutputProps) {
const { referenceStr } = props;

Expand Down Expand Up @@ -50,6 +49,7 @@ function ReferenceOutput(props: ReferenceOutputProps) {
}

function MetaOutput(props: TextOutputProps) {
const strings = useTranslation(i18n);
const {
className,
invalidText,
Expand All @@ -58,8 +58,6 @@ function MetaOutput(props: TextOutputProps) {
...otherProps
} = props;

const strings = useTranslation(i18n);

return (
<TextOutput
// eslint-disable-next-line react/jsx-props-no-spreading
Expand All @@ -79,6 +77,7 @@ interface Props {
}

function AlertMetadata(props: Props) {
const strings = useTranslation(i18n);
const {
className,
data,
Expand All @@ -90,54 +89,54 @@ function AlertMetadata(props: Props) {
childrenContainerClassName={styles.content}
>
<MetaOutput
label="Message type"
label={strings.alertMetaDataMessageType}
value={data?.msgTypeDisplay}
/>
<MetaOutput
label="Sent by"
label={strings.alertMetaDataSentBy}
value={data?.sender}
/>
<MetaOutput
label="Sent on"
label={strings.alertMetaDataSentOn}
value={data?.sent}
valueType="date"
/>
<MetaOutput
label="Source"
label={strings.alertMetaDataSource}
value={data?.source}
/>
<MetaOutput
label="Scope"
label={strings.alertMetaDataScope}
value={data?.scope}
/>
<MetaOutput
label="Restriction"
label={strings.alertMetaDataRestriction}
value={data?.restriction}
/>
<MetaOutput
label="Addresses"
label={strings.alertMetaDataAddresses}
value={data?.addresses}
/>
<MetaOutput
label="Handling Code"
label={strings.alertMetaDataHandlingCode}
value={data?.code}
/>
<MetaOutput
label="Note"
label={strings.alertMetaDataNote}
value={data?.note}
/>
<MetaOutput
label="Incident IDs"
label={strings.alertMetaDataIncidentIds}
value={data?.incidents}
/>
<MetaOutput
valueClassName={styles.url}
label="URL"
label={strings.alertMetaDataURL}
value={data?.url}
/>
<MetaOutput
valueClassName={styles.references}
label="References"
label={strings.alertMetaDataReferences}
value={data?.references?.split(' ').map(
(referenceStr) => (
<ReferenceOutput
Expand Down
7 changes: 7 additions & 0 deletions src/views/Preferences/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"namespace": "preference",
"strings": {
"preferencesTitle":"Preferences",
"preferencesGoToHome":" Go to Home"
}
}
8 changes: 6 additions & 2 deletions src/views/Preferences/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { Link } from 'react-router-dom';
import { useTranslation } from '@ifrc-go/ui/hooks';

import { wrappedRoutes } from '../../App/routes';

import i18n from './i18n.json';

// eslint-disable-next-line import/prefer-default-export
export function Component() {
const strings = useTranslation(i18n);
return (
<>
<h1>
Preferences
{strings.preferencesTitle}
</h1>
<Link to={wrappedRoutes.root.absolutePath}>
Go to home
{strings.preferencesGoToHome}
</Link>
</>
);
Expand Down
1 change: 1 addition & 0 deletions src/views/Resources/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"namespace": "resources",
"strings": {
"resourceHeadingTitle": "Resources",
"resourceAlerthubTitle":"AlertHub - Resources",
"resourceHeadingDescription":"Alert Hub is an open source web project developed in collaboration with the International Federation of Red Cross and Red Crescent Societies (IFRC) as a part of the University College London (UCL) Industry Exchange Network (IXN). You can find all the source code and instructions under the following repositories.",
"resourceAlertHubAPIs":"Alert Hub APIs",
"resourceAlertHubAPIsDescription":"Alert Hub APIs enable third-party developers and rebroadcasters to access alerts and alert feed.",
Expand Down
2 changes: 1 addition & 1 deletion src/views/Resources/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function Component() {
return (
<Page
className={styles.resources}
title="AlertHub - Resources"
title={strings.resourceAlerthubTitle}
heading={strings.resourceHeadingTitle}
description={strings.resourceHeadingDescription}
>
Expand Down
3 changes: 2 additions & 1 deletion src/views/SourcesList/i18n.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"namespace": "viewAllSource",
"strings": {
"sourceFeedsTitle":"Source Feeds"
"sourceFeedsTitle":"Source Feeds",
"alertHubSourceTitle":"AlertHub - Sources"
}
}
2 changes: 1 addition & 1 deletion src/views/SourcesList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function Component() {

return (
<Page
title="AlertHub - Sources"
title={strings.alertHubSourceTitle}
heading={strings.sourceFeedsTitle}
>
<Container
Expand Down

0 comments on commit f64f56a

Please sign in to comment.