New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I18n spanish 450 #457
I18n spanish 450 #457
Changes from 5 commits
64f46d7
8ca5bcb
ad3c6da
de08b6c
b62aed7
f4948d9
3a82fc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ import { useHistory } from "react-router"; | |
import { useLastLocation } from "react-router-last-location"; | ||
import { useParams } from "react-router-dom"; | ||
import useResources from "./useResources"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
const useListIconStyles = makeStyles((theme: Theme) => ({ | ||
root: { | ||
|
@@ -69,6 +70,7 @@ export const Resource = () => { | |
const listIconClasses = useListIconStyles({}); | ||
const history = useHistory(); | ||
const lastLocation = useLastLocation(); | ||
const { t } = useTranslation(["resource"]); | ||
|
||
if (status === "loading") { | ||
return <LoadingSpinner />; | ||
|
@@ -111,11 +113,11 @@ export const Resource = () => { | |
{resource.address && ( | ||
<ListItem component="div"> | ||
<ListItemIcon classes={listIconClasses}> | ||
<LocationOnIcon /> | ||
<LocationOnIcon titleAccess={t("address")} /> | ||
</ListItemIcon> | ||
<ListItemText> | ||
<Typography component="h2" variant="srOnly"> | ||
Address | ||
{t("address")} | ||
</Typography> | ||
{resource.address.address1},{" "} | ||
{resource.address.address2 && <>{resource.address.address2}, </>} | ||
|
@@ -127,11 +129,11 @@ export const Resource = () => { | |
{resource.phone && ( | ||
<ListItem component="div"> | ||
<ListItemIcon classes={listIconClasses}> | ||
<PhoneIcon /> | ||
<PhoneIcon titleAccess={t("phoneNumber")} /> | ||
</ListItemIcon> | ||
<ListItemText> | ||
<Typography component="h2" variant="srOnly"> | ||
Phone | ||
{t("phoneNumber")} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like your thinking here, but in this case I don't think we need to have the title on the icon. The Adding a title to the icon as well means a SR would read "phone number" twice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! f4948d9 |
||
</Typography> | ||
{resource.phone} | ||
</ListItemText> | ||
|
@@ -140,11 +142,11 @@ export const Resource = () => { | |
{resource.website && ( | ||
<ListItem component="div"> | ||
<ListItemIcon classes={listIconClasses}> | ||
<PublicIcon /> | ||
<PublicIcon titleAccess={t("website")} /> | ||
</ListItemIcon> | ||
<ListItemText> | ||
<Typography component="h2" variant="srOnly"> | ||
Website | ||
{t("website")} | ||
</Typography> | ||
<Typography noWrap={true} color="primary"> | ||
<Link | ||
|
@@ -162,18 +164,18 @@ export const Resource = () => { | |
{!!resource.schedule._items.length && ( | ||
<ListItem component="div"> | ||
<ListItemIcon classes={listIconClasses}> | ||
<ScheduleIcon /> | ||
<ScheduleIcon titleAccess={t("hoursOfOperation")} /> | ||
</ListItemIcon> | ||
<ListItemText> | ||
<Typography component="h2" variant="srOnly"> | ||
Schedule | ||
{t("hoursOfOperation")} | ||
</Typography> | ||
<Schedule schedule={resource.schedule} /> | ||
</ListItemText> | ||
</ListItem> | ||
)} | ||
<ListItem component="div"> | ||
<Typography variant="srOnly">Services</Typography> | ||
<Typography variant="srOnly">{t("services")}</Typography> | ||
<Services resource={resource} /> | ||
</ListItem> | ||
</List> | ||
|
@@ -191,7 +193,7 @@ export const Resource = () => { | |
startIcon={<ReportProblemIcon color="secondary" />} | ||
to={`/report-issue/${resourceId}`} | ||
> | ||
Report a Problem | ||
{t("reportAProblem")} | ||
</Button> | ||
<FavoriteResourceFAB resourceId={resourceId} /> | ||
</Container> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Def good call on adding these!