Skip to content

Commit

Permalink
Auto update copyright year
Browse files Browse the repository at this point in the history
  • Loading branch information
lizziemac committed Jan 13, 2025
1 parent a7c555a commit 4e582ae
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
6 changes: 3 additions & 3 deletions app/common/components/ThemeToggle/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { translate, COMMON } from 'app/utils/localize';
import i18n, { COMMON } from 'app/utils/localize';
import { ReactElement } from 'react';
import { getTheme } from 'app/utils/hooks/useTheme';

Expand All @@ -15,8 +15,8 @@ interface ToggleProps {
const Toggle = ({ handleToggle }: ToggleProps): ReactElement => {
return (
<Button
aria-label={translate(COMMON.COMPONENTS.THEME_TOGGLE.ALT_LABEL)}
aria-details={translate(COMMON.COMPONENTS.THEME_TOGGLE.ALT_DETAILS)}
aria-label={i18n.t(COMMON.COMPONENTS.THEME_TOGGLE.ALT_LABEL)}
aria-details={i18n.t(COMMON.COMPONENTS.THEME_TOGGLE.ALT_DETAILS)}
onClick={(): void => handleToggle()}
>
{
Expand Down
3 changes: 2 additions & 1 deletion app/pages/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import i18n, { PAGES } from 'app/utils/localize';
import { Foot } from './styles';

const Footer = (): ReactElement => {
const currentYear = new Date().getFullYear();
return (
<Foot>{i18n.t(PAGES.FOOTER)}</Foot>
<Foot>{i18n.t(PAGES.FOOTER, { replace: { year: currentYear }})}</Foot>
);
};

Expand Down
5 changes: 2 additions & 3 deletions app/utils/localize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ void i18n
.use(initReactI18next)
.use(LanguageDetector)
.init({
fallbackLng: ['en'],
debug: false,
detection: languageDetectorOptions,
resources: {
en: { translation: en },
es: { translation: es }
es: { translation: es },
},
fallbackLng: ['en']
});

export * from './keys';
export * from './tools';

export default i18n;
6 changes: 0 additions & 6 deletions app/utils/localize/tools.ts

This file was deleted.

4 changes: 2 additions & 2 deletions app/utils/localize/translations/english/pages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PAGES } from 'app/utils/localize/keys';

export default {
[PAGES.FOOTER]: 2022 Liz MacLean',
[PAGES.FOOTER]: {{year}} Liz MacLean',
[PAGES.HOME.NAV_LINK]: 'Home',
[PAGES.HOME.TITLE]: 'Welcome!',
[PAGES.HOME.SUBTITLE]: 'Check out this code formatting',
Expand All @@ -27,7 +27,7 @@ export default {
),
[PAGES.ABOUT.BLURB_P3]: (
'If you\'re curious about the fluffy cat in the drawing on this page, his name is Poe! I adopted him '
+ 'almost four years ago, and he\'s my favorite fluffy friend. His favorite things to do are nap, meow, '
+ 'in 2018, and he\'s my favorite fluffy friend. His favorite things to do are nap, meow, '
+ 'snuggle, and play with homemade foil balls. He doesn\'t really understand what the internet is, '
+ 'but I think if he knew that\'s where all his treats came from, he\'d think it\'s as cool as I think it is.'
)
Expand Down
2 changes: 1 addition & 1 deletion app/utils/localize/translations/spanish/pages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PAGES } from 'app/utils/localize/keys';

export default {
[PAGES.FOOTER]: 2022 Liz MacLean,',
[PAGES.FOOTER]: {{year}} Liz MacLean',
[PAGES.HOME.NAV_LINK]: 'Inicio',
[PAGES.HOME.TITLE]: '¡Bienvenido!',
[PAGES.HOME.SUBTITLE]: 'Echa un vistazo a este formato de código',
Expand Down

0 comments on commit 4e582ae

Please sign in to comment.