Files
hugo-theme-stack/i18n/ko.toml
T
4ad88a327e feat: add GDPR cookie consent banner (#1216)
* feat: add GDPR cookie consent banner

Add a GDPR-compliant cookie consent banner that gates analytics (Google
Analytics) and functional cookies (comments) until user consent is given.

Features:
- Theme-consistent styling using CSS variables (light/dark mode)
- Settings panel with category toggles (necessary, analytics, functional)
- Consent stored in cookie for 365 days
- Google Analytics only loads after analytics consent
- Comments only load after functional consent
- Translations for all 32 supported languages
- Accessible with proper ARIA attributes and focus management

Configuration in hugo.yaml:
  params:
    cookies:
      enabled: true
      categories:
        analytics: true
        functional: true

When cookies.enabled is false, scripts load normally without consent gating.

Closes #412

* refactor: move consent-gated GA to cookies/analytics.html

Move Google Analytics consent logic to avoid shadowing Hugo's internal
`_internal/google_analytics.html` template.

Changes:
- Rename google_analytics.html → cookies/analytics.html
- Update head.html to conditionally load:
  - cookies.enabled=true: cookies/analytics.html (consent-gated)
  - cookies.enabled=false: Hugo's _internal/google_analytics.html
- Align cookies/analytics.html with Hugo's internal template:
  - Support Privacy.GoogleAnalytics.Disable setting
  - Support Privacy.GoogleAnalytics.RespectDoNotTrack setting
  - Add UA- prefix deprecation warning

Note: Custom JS is required for consent-gated GA because Hugo templates
render at build time, but consent happens at runtime. We cannot call
Hugo's internal template after the user grants consent - we must
dynamically inject the GA script via JavaScript.

* style: indent cookies/analytics.html

* refactor: don't use default, put default configurations in params.toml

* fix: don't use `description` as translation key because it's reserved and will throw error

* fix: remove footer/components/custom-font.html call

* fix: banner showSettings key

* style: indent comments/include

* Add missing article.alert translation back

* style: format i18n toml files

* style: indent head/head.html

* style adjustment

* style: add missing -

* style: format demo/config/params.toml

* style: remove redundant comments from cookies.scss

* style: update box-shadow for cookie banner content

---------

Co-authored-by: delize <4028612+delize@users.noreply.github.com>
Co-authored-by: Jimmy Cai <jimmy@cai.im>
2026-02-19 17:21:25 +01:00

79 lines
2.3 KiB
TOML

toggleMenu = "메뉴 여닫기"
darkMode = "다크 모드"
[list]
section = "섹션"
[list.page]
one = "{{ .Count }} 페이지"
other = "{{ .Count }} 페이지"
[list.subsection]
one = "서브섹션"
other = "서브섹션"
[article]
back = "뒤로가기"
tableOfContents = "목차"
relatedContent = "관련 글"
lastUpdatedOn = "마지막 수정: "
[article.readingTime]
one = "{{ .Count }} 분 정도"
other = "{{ .Count }} 분 정도"
[article.alert]
note = "참고"
tip = "팁"
important = "중요"
warning = "경고"
caution = "주의"
[notFound]
title = "찾을 수 없음"
subtitle = "페이지를 찾을 수 없습니다."
[widget]
[widget.archives]
title = "보관함"
more = "더보기"
[widget.categoriesCloud]
title = "카테고리"
[widget.tagCloud]
title = "태그"
[search]
title = "검색"
placeholder = "검색어를 입력하세요..."
resultTitle = "#PAGES_COUNT 페이지 (#TIME_SECONDS 초)"
[footer]
builtWith = "{{ .Generator }}로 만듦"
designedBy = "{{ .DesignedBy }}의 {{ .Theme }} 테마 사용 중"
[cookies]
title = "쿠키 동의"
text = "브라우징 경험을 향상시키고 사이트 트래픽을 분석하기 위해 쿠키를 사용합니다."
acceptAll = "모두 허용"
deny = "거부"
managePreferences = "설정 관리"
settingsTitle = "쿠키 설정"
savePreferences = "설정 저장"
cancel = "취소"
footerLink = "쿠키 설정"
commentsDisabled = "기능적 쿠키를 수락할 때까지 댓글이 비활성화됩니다."
[cookies.necessary]
title = "필수"
text = "이 쿠키는 웹사이트 기능에 필요하며 비활성화할 수 없습니다."
[cookies.analytics]
title = "분석"
text = "이 쿠키는 방문자가 웹사이트와 상호작용하는 방식을 이해하는 데 도움이 됩니다."
[cookies.functional]
title = "기능적"
text = "이 쿠키는 댓글 및 임베디드 콘텐츠와 같은 기능을 활성화합니다."