Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>

{{!-- Basic meta - advanced meta is output with {{ghost_head}} below --}}
<title>{{meta_title}}</title>
<title>{{meta_title page=(t "Page %")}}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

Expand Down
39 changes: 39 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"1 min read": "",
"Access site": "",
"Account": "",
"Already have an account?": "",
"Close (Esc)": "",
"Featured": "",
"jamie@example.com": "",
"Latest": "",
"Menu": "",
"Newer Posts": "",
"Next (arrow right)": "",
"Older Posts": "",
"Page {page} of {totalPages}": "",
"Page %": "",
"Password": "",
"Powered by {ghostlink}": "",
"Previous (arrow left)": "",
"Read more": "",
"Recommendations": "",
"Search posts, tags and authors": "",
"Search this site": "",
"See all": "",
"Share": "",
"Sign in": "",
"Subscribe": "",
"Subscribe now": "",
"This page is for paying subscribers only": "",
"This page is for subscribers on the {tiers} only": "",
"This page is for subscribers only": "",
"This post is for paying subscribers only": "",
"This post is for subscribers on the {tiers} only": "",
"This post is for subscribers only": "",
"This site is private.": "",
"Toggle fullscreen": "",
"Upgrade": "",
"Upgrade your account": "",
"Zoom in/out": ""
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing translation keys in English locale file

The English locale file en.json is missing two translation keys that are used in templates and exist in fr.json: "% min read" (used in post.hbs for the reading_time helper's minutes parameter) and "and" (used in content-cta.hbs for tier list separators). This inconsistency between locale files may cause translation lookups to fail or display incorrect text for English users.

Additional Locations (2)

Fix in Cursor Fix in Web

41 changes: 41 additions & 0 deletions locales/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"1 min read": "1 min de lecture",
"% min read": "% min de lecture",
"and": "et",
"Access site": "Accéder au site",
"Account": "Compte",
"Already have an account?": "Vous avez déjà un compte ?",
"Close (Esc)": "Fermer (Échap)",
"Featured": "À la une",
"jamie@example.com": "jean@example.com",
"Latest": "Derniers",
"Menu": "Menu",
"Newer Posts": "Articles plus récents",
"Next (arrow right)": "Suivant (flèche droite)",
"Older Posts": "Articles plus anciens",
"Page {page} of {totalPages}": "Page {page} sur {totalPages}",
"Page %": "Page %",
"Password": "Mot de passe",
"Powered by {ghostlink}": "Propulsé par {ghostlink}",
"Previous (arrow left)": "Précédent (flèche gauche)",
"Read more": "Lire la suite",
"Recommendations": "Recommandations",
"Search posts, tags and authors": "Rechercher des articles, tags et auteurs",
"Search this site": "Rechercher sur ce site",
"See all": "Voir tout",
"Share": "Partager",
"Sign in": "Se connecter",
"Subscribe": "S'abonner",
"Subscribe now": "S'abonner maintenant",
"This page is for paying subscribers only": "Cette page est réservée aux abonnés payants uniquement",
"This page is for subscribers on the {tiers} only": "Cette page est réservée aux abonnés sur les {tiers} uniquement",
"This page is for subscribers only": "Cette page est réservée aux abonnés uniquement",
"This post is for paying subscribers only": "Cet article est réservé aux abonnés payants uniquement",
"This post is for subscribers on the {tiers} only": "Cet article est réservé aux abonnés sur les {tiers} uniquement",
"This post is for subscribers only": "Cet article est réservé aux abonnés uniquement",
"This site is private.": "Ce site est privé.",
"Toggle fullscreen": "Basculer en plein écran",
"Upgrade": "Mettre à niveau",
"Upgrade your account": "Mettre à niveau votre compte",
"Zoom in/out": "Zoom avant/arrière"
}
2 changes: 1 addition & 1 deletion partials/components/featured.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{#get "posts" filter="featured:true" include="authors" limit=limit as |featured|}}
<section class="gh-featured gh-outer">
<div class="gh-featured-inner gh-inner">
<h2 class="gh-featured-title">Featured</h2>
<h2 class="gh-featured-title">{{t "Featured"}}</h2>
<div class="gh-featured-feed">
{{#foreach featured}}
{{> "post-card" imageSizes="80px"}}
Expand Down
2 changes: 1 addition & 1 deletion partials/components/footer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{navigation type="secondary"}}
</nav>
<div class="gh-footer-copyright">
Powered by <a href="https://ghost.org/" target="_blank" rel="noopener">Ghost</a>
{{{t "Powered by {ghostlink}" ghostlink="<a href=\"https://ghost.org/\" target=\"_blank\" rel=\"noopener\">Ghost</a>"}}}
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion partials/components/header-content.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<h1 class="gh-header-title is-title">{{#if @custom.header_text}}{{@custom.header_text}}{{else}}{{@site.description}}{{/if}}</h1>
<form class="gh-form">
{{> "icons/search"}}
<button class="gh-form-input" data-ghost-search>Search posts, tags and authors</button>
<button class="gh-form-input" data-ghost-search>{{t "Search posts, tags and authors"}}</button>
</form>
{{/match}}

Expand Down
10 changes: 5 additions & 5 deletions partials/components/navigation.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{/if}}
</a>
{{> "search-toggle"}}
<button class="gh-burger gh-icon-button" aria-label="Menu">
<button class="gh-burger gh-icon-button" aria-label="{{t "Menu"}}">
{{> "icons/burger"}}
{{> "icons/close"}}
</button>
Expand All @@ -35,15 +35,15 @@
<div class="gh-navigation-members">
{{#unless @member}}
{{#unless @site.members_invite_only}}
<a href="#/portal/signin" data-portal="signin">Sign in</a>
<a href="#/portal/signin" data-portal="signin">{{t "Sign in"}}</a>
{{#unless hideSubscribeButton}}
<a class="gh-button" href="#/portal/signup" data-portal="signup">Subscribe</a>
<a class="gh-button" href="#/portal/signup" data-portal="signup">{{t "Subscribe"}}</a>
{{/unless}}
{{else}}
<a class="gh-button" href="#/portal/signin" data-portal="signin">Sign in</a>
<a class="gh-button" href="#/portal/signin" data-portal="signin">{{t "Sign in"}}</a>
{{/unless}}
{{else}}
<a class="gh-button" href="#/portal/account" data-portal="account">Account</a>
<a class="gh-button" href="#/portal/account" data-portal="account">{{t "Account"}}</a>
{{/unless}}
</div>
{{/unless}}
Expand Down
12 changes: 6 additions & 6 deletions partials/components/post-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{{#if showTitle}}
<h2 class="gh-container-title">
{{#unless title}}Latest{{else}}{{title}}{{/unless}}
{{#unless title}}{{t "Latest"}}{{else}}{{title}}{{/unless}}
</h2>
{{/if}}

Expand Down Expand Up @@ -80,7 +80,7 @@

{{#match pagination.pages ">" 1}}
<div class="gh-more is-title">
<a href="{{@site.url}}/page/2">See all {{> "icons/arrow"}}</a>
<a href="{{@site.url}}/page/2">{{t "See all"}} {{> "icons/arrow"}}</a>
</div>
{{/match}}
</main>
Expand All @@ -98,21 +98,21 @@
{{/if}}
{{#if @site.members_enabled}}
{{#unless @member}}
<button class="gh-button" data-portal="signup">Subscribe</button>
<button class="gh-button" data-portal="signup">{{t "Subscribe"}}</button>
{{else}}
{{#if @site.paid_members_enabled}}
{{#unless @member.paid}}
<button class="gh-button" data-portal="upgrade">Upgrade</button>
<button class="gh-button" data-portal="upgrade">{{t "Upgrade"}}</button>
{{/unless}}
{{/if}}
{{/unless}}
{{/if}}
</section>
{{#if @site.recommendations_enabled}}
<section class="gh-recommendations">
<h4 class="gh-sidebar-title">Recommendations</h4>
<h4 class="gh-sidebar-title">{{t "Recommendations"}}</h4>
{{recommendations}}
<button data-portal="recommendations">See all {{> "icons/arrow"}}</button>
<button data-portal="recommendations">{{t "See all"}} {{> "icons/arrow"}}</button>
</section>
{{/if}}
</div>
Expand Down
32 changes: 32 additions & 0 deletions partials/content-cta.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{{html}}}
<aside class="gh-post-upgrade-cta">
<div class="gh-post-upgrade-cta-content" style="background-color: {{@site.accent_color}}">
{{#has visibility="paid"}}
{{#is "page"}}
<h2>{{t "This page is for paying subscribers only"}}</h2>
{{else}}
<h2>{{t "This post is for paying subscribers only"}}</h2>
{{/is}}
{{/has}}
{{#has visibility="members"}}
{{#is "page"}}
<h2>{{t "This page is for subscribers only"}}</h2>
{{else}}
<h2>{{t "This post is for subscribers only"}}</h2>
{{/is}}
{{/has}}
{{#has visibility="tiers"}}
{{#is "page"}}
<h2>{{t "This page is for subscribers on the {tiers} only" tiers=(tiers separator=", " lastSeparator=(concat " " (t "and") " "))}}</h2>
{{else}}
<h2>{{t "This post is for subscribers on the {tiers} only" tiers=(tiers separator=", " lastSeparator=(concat " " (t "and") " "))}}</h2>
{{/is}}
{{/has}}
{{#if @member}}
<a class="gh-btn" data-portal="account/plans" href="#/portal/account/plans" style="color:{{@site.accent_color}}">{{t "Upgrade your account"}}</a>
{{else}}
<a class="gh-btn" data-portal="signup" href="#/portal/signup" style="color:{{@site.accent_color}}">{{t "Subscribe now"}}</a>
<p><small>{{t "Already have an account?"}} <a data-portal="signin" href="#/portal/signin">{{t "Sign in"}}</a></small></p>
{{/if}}
</div>
</aside>
4 changes: 2 additions & 2 deletions partials/email-subscription.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form class="gh-form" data-members-form>
<input class="gh-form-input" id="{{email_field_id}}" name="email" type="email" placeholder="jamie@example.com" required data-members-email>
<input class="gh-form-input" id="{{email_field_id}}" name="email" type="email" placeholder="{{t "jamie@example.com"}}" required data-members-email>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Untranslated aria-label inconsistent with visible translated text

The aria-label="Subscribe" attribute remains hardcoded in English while the visible button text was updated to use {{t "Subscribe"}} for translation. This inconsistency means screen reader users will hear "Subscribe" in English even when the visible text is translated to French. Other templates in this PR correctly translate aria-labels (e.g., aria-label="{{t "Menu"}}" in navigation.hbs).

Fix in Cursor Fix in Web

<button class="gh-button" type="submit" aria-label="Subscribe">
<span><span>Subscribe</span> {{> "icons/arrow"}}</span>
<span><span>{{t "Subscribe"}}</span> {{> "icons/arrow"}}</span>
{{> "icons/loader"}}
{{> "icons/checkmark"}}
</button>
Expand Down
12 changes: 6 additions & 6 deletions partials/lightbox.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<div class="pswp__top-bar">
<div class="pswp__counter"></div>

<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<button class="pswp__button pswp__button--close" title="{{t "Close (Esc)"}}"></button>
<button class="pswp__button pswp__button--share" title="{{t "Share"}}"></button>
<button class="pswp__button pswp__button--fs" title="{{t "Toggle fullscreen"}}"></button>
<button class="pswp__button pswp__button--zoom" title="{{t "Zoom in/out"}}"></button>

<div class="pswp__preloader">
<div class="pswp__preloader__icn">
Expand All @@ -30,8 +30,8 @@
<div class="pswp__share-tooltip"></div>
</div>

<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>
<button class="pswp__button pswp__button--arrow--left" title="{{t "Previous (arrow left)"}}"></button>
<button class="pswp__button pswp__button--arrow--right" title="{{t "Next (arrow right)"}}"></button>

<div class="pswp__caption">
<div class="pswp__caption__center"></div>
Expand Down
9 changes: 9 additions & 0 deletions partials/pagination.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<nav class="pagination">
{{#if prev}}
<a class="newer-posts" href="{{page_url prev}}"><span aria-hidden="true">&larr;</span> {{t "Newer Posts"}}</a>
{{/if}}
<span class="page-number">{{t "Page {page} of {totalPages}" page=page totalPages=pages}}</span>
{{#if next}}
<a class="older-posts" href="{{page_url next}}">{{t "Older Posts"}} <span aria-hidden="true">&rarr;</span></a>
{{/if}}
</nav>
2 changes: 1 addition & 1 deletion partials/search-toggle.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<button class="gh-search gh-icon-button" aria-label="Search this site" data-ghost-search>
<button class="gh-search gh-icon-button" aria-label="{{t "Search this site"}}" data-ghost-search>
{{> "icons/search"}}
</button>
4 changes: 2 additions & 2 deletions post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="gh-article-meta-content">
<time class="gh-article-meta-date" datetime="{{date format="YYYY-MM-DD"}}">{{date format="DD MMM YYYY"}}</time>
{{#if reading_time}}
<span class="gh-article-meta-length"><span class="bull">—</span> {{reading_time}}</span>
<span class="gh-article-meta-length"><span class="bull">—</span> {{reading_time minute=(t "1 min read") minutes=(t "% min read")}}</span>
{{/if}}
</div>
</div>
Expand Down Expand Up @@ -67,7 +67,7 @@
{{#if next}}
<section class="gh-container is-grid gh-outer">
<div class="gh-container-inner gh-inner">
<h2 class="gh-container-title">Read more</h2>
<h2 class="gh-container-title">{{t "Read more"}}</h2>
<div class="gh-feed">
{{#foreach next}}
{{> "post-card" lazyLoad=true}}
Expand Down
67 changes: 67 additions & 0 deletions private.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Hardcoded language attribute ignores site locale setting

The new private.hbs template has a hardcoded lang="en" attribute, while default.hbs correctly uses lang="{{@site.locale}}". This causes the private page to always indicate English to browsers and screen readers, even when the page content is displayed in French or another language. The translated strings on this page (like "This site is private." and "Password") will be in the correct language, but the HTML document will incorrectly declare itself as English.

Fix in Cursor Fix in Web

<head>
<meta charset="UTF-8" />

<title>{{@site.title}}</title>
<meta property="og:type" content="website">
<meta property="og:site_name" content="{{@site.title}}">
<meta property="og:title" content="{{@site.title}}">
<meta name="twitter:title" content="{{@site.title}}">

<link rel="canonical" href="{{@site.url}}">
<meta property="og:url" content="{{@site.url}}">
<meta name="twitter:url" content="{{@site.url}}">

{{#if @site.icon}}
<link rel="icon" href="{{img_url @site.icon absolute="true"}}" type="image/png">
{{/if}}

{{#if @site.description}}
<meta name="description" content="{{@site.description}}">
<meta property="og:description" content="{{@site.description}}">
<meta name="twitter:description" content="{{@site.description}}">
{{/if}}

{{#if @site.cover_image}}
<meta property="og:image" content="{{img_url @site.cover_image absolute="true"}}">
<meta name="twitter:image" content="{{img_url @site.cover_image absolute="true"}}">
{{/if}}

<meta name="referrer" content="no-referrer-when-downgrade">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />

<link rel="stylesheet" href="{{asset "public/ghost.css" hasMinFile="true"}}"/>
</head>
<body>
<div class="gh-app">
<div class="gh-viewport">
<main class="gh-main" role="main">
<div class="gh-flow">
<div class="gh-flow-content-wrap">
{{#if @site.icon}}
<img class="site-icon" src="{{img_url @site.icon absolute="true"}}" alt="icon">
{{/if}}
<section class="gh-flow-content private">
<header>
<h1>{{t "This site is private."}}</h1>
</header>
<form class="gh-signin" method="post" novalidate="novalidate">
<div class="form-group{{#if error}} error{{/if}}">
{{input_password class="gh-input" placeholder=(t "Password")}}
{{#if error}}
<p class="main-error">{{error.message}}</p>
{{/if}}
</div>
<button class="gh-btn" type="submit"><span>{{t "Access site"}} &rarr;</span></button>
</form>
</section>
</div>
</div>
</main>
</div>
</div>
</body>
</html>