Skip to content

Commit

Permalink
chore: move translations into i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
noa.santo committed Oct 30, 2024
1 parent c07d055 commit acb22b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/assets/locales/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,8 @@
"blog.copied": "Kopiert",
"blog.follow": "Blog abonnieren",
"blog.pagination": "Seite",
"image.attribution": "Foto von "
"image.attribution": "Foto von ",
"iframemanager.youtube.notice": "Dieser Inhalt wird von einer externen Quelle gehostet. Durch das Laden des Inhalts akzeptieren Sie die <a rel=\"noreferrer noopener\" href=\"https://www.youtube.com/t/terms\" target=\"_blank\">Nutzungsbedingungen</a> von youtube.com.",
"iframemanager.youtube.load-button": "Inhalt laden",
"iframemanager.youtube.load-all-button": "Inhalt laden und nicht mehr fragen"
}
5 changes: 4 additions & 1 deletion src/assets/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,8 @@
"blog.copied": "Copied",
"blog.follow": "Subscribe to blog",
"blog.pagination": "Page",
"image.attribution": "Photo by "
"image.attribution": "Photo by ",
"iframemanager.youtube.notice": "This content is hosted by a third party. By showing the external content you accept the <a rel=\"noreferrer noopener\" href=\"https://www.youtube.com/t/terms\" target=\"_blank\">terms and conditions</a> of youtube.com.",
"iframemanager.youtube.load-button": "Load content",
"iframemanager.youtube.load-all-button": "Load content and don't ask again"
}
11 changes: 5 additions & 6 deletions src/components/cookie-consent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import deCookieConsentTranslations from '../assets/locales/de/cookie-consent-tra
import { useTranslation } from 'react-i18next';

export const CookieConsent = () => {
const { i18n } = useTranslation();
const { t, i18n } = useTranslation();
// @ts-expect-error - iframemanager is defined at runtime
const im = iframemanager();

Expand Down Expand Up @@ -38,17 +38,16 @@ export const CookieConsent = () => {
},
languages: {
en: {
notice:
'This content is hosted by a third party. By showing the external content you accept the <a rel="noreferrer noopener" href="https://www.youtube.com/t/terms" target="_blank">terms and conditions</a> of youtube.com.',
loadBtn: 'Load video',
loadAllBtn: "Load video and don't ask again",
notice: t('iframemanager.youtube.notice'),
loadBtn: t('iframemanager.youtube.load-button'),
loadAllBtn: t('iframemanager.youtube.load-all-button'),
},
de: {
notice:
'Dieser Inhalt wird von einer externen Quelle gehostet. Durch das Laden des Inhalts akzeptieren Sie die <a rel="noreferrer noopener" href="https://www.youtube.com/t/terms" target="_blank">Nutzungsbedingungen</a> von youtube.com.',
loadBtn: 'Video laden',
loadAllBtn: 'Video laden und nicht mehr fragen',
}, // TODO: Move translations to i18n
},
},
},
},
Expand Down

0 comments on commit acb22b9

Please sign in to comment.