Skip to content

Commit

Permalink
refactor: finish page-languages deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
wackerow committed Mar 25, 2024
1 parent 5fbfcd6 commit fc4d107
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/LanguagePicker/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const MenuItem = forwardRef(({ displayInfo, ...props }: ItemProps, ref) => {
wordsApproved,
isBrowserDefault,
} = displayInfo
const { t } = useTranslation("page-languages")
const { t } = useTranslation("common")
const { asPath, locale } = useRouter()
const isCurrent = localeOption === locale

Expand Down
2 changes: 1 addition & 1 deletion src/components/LanguagePicker/NoResultsCallout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type NoResultsCalloutProps = { onClose: () => void }

const NoResultsCallout = forwardRef(
({ onClose }: NoResultsCalloutProps, ref) => {
const { t } = useTranslation("page-languages")
const { t } = useTranslation("common")
return (
<FormHelperText color="body.medium" lineHeight="base" fontSize="md">
<Text fontWeight="bold" mb="2" color="body.base">
Expand Down
2 changes: 1 addition & 1 deletion src/components/LanguagePicker/useLanguagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useLanguagePicker = (
handleClose?: () => void,
menuState?: UseDisclosureReturn
) => {
const { t } = useTranslation("page-languages")
const { t } = useTranslation("common")
const { locale, locales: rawLocales } = useRouter()
const refs = {
inputRef: useRef<HTMLInputElement>(null),
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const getRequiredNamespacesForPage = (
path: string,
layout?: string | undefined
) => {
const baseNamespaces = ["common", "page-languages"]
const baseNamespaces = ["common"]

const requiredNamespacesForPath = getRequiredNamespacesForPath(path)
const requiredNamespacesForLayout = getRequiredNamespacesForLayout(layout)
Expand Down
15 changes: 7 additions & 8 deletions src/pages/contributing/translation-program/contributors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ const ContentHeading = (props: HeadingProps) => (
)

const Contributors = () => {
const { t } = useTranslation([
"page-contributing-translation-program-contributors",
"page-languages",
])
const { t } = useTranslation(
"page-contributing-translation-program-contributors"
)
const router = useRouter()

// TODO: Remove specific user checks once Acolad has updated their usernames
Expand Down Expand Up @@ -149,9 +148,9 @@ const Contributors = () => {
)}
</Text>
<Text>
{t("page-languages:page-languages-interested")}{" "}
{t("common:page-languages-interested")}{" "}
<InlineLink href="/contributing/translation-program/">
{t("page-languages:page-languages-learn-more")}
{t("common:page-languages-learn-more")}
</InlineLink>
.
</Text>
Expand All @@ -177,9 +176,9 @@ const Contributors = () => {
})}
</SimpleGrid>
<Text>
{t("page-languages:page-languages-interested")}{" "}
{t("common:page-languages-interested")}{" "}
<InlineLink href="/contributing/translation-program/">
{t("page-languages:page-languages-learn-more")}
{t("common:page-languages-learn-more")}
</InlineLink>
.
</Text>
Expand Down

0 comments on commit fc4d107

Please sign in to comment.