mirror of
https://github.com/GenZmeY/casper-i18n.git
synced 2024-11-10 02:28:02 +00:00
feat: localization
This commit is contained in:
parent
4c298b97cf
commit
cacbd0b01b
@ -25,7 +25,7 @@
|
||||
<div class="author-location">{{location}}</div>
|
||||
{{/if}}
|
||||
<div class="author-stats">
|
||||
{{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}}
|
||||
{{plural ../pagination.total empty=(t "No posts") singular=(t "1 post") plural=(t "% posts")}}
|
||||
</div>
|
||||
{{#if website}}
|
||||
<span class="author-social-link"><a href="{{website}}" target="_blank" rel="noopener">Website</a></span>
|
||||
|
16
default.hbs
16
default.hbs
@ -30,7 +30,7 @@
|
||||
<div class="site-footer-content inner">
|
||||
<section class="copyright"><a href="{{@site.url}}">{{@site.title}}</a> © {{date format="YYYY"}}</section>
|
||||
<nav class="site-footer-nav">
|
||||
<a href="{{@site.url}}">Latest Posts</a>
|
||||
<a href="{{@site.url}}">{{t "Latest Posts"}}</a>
|
||||
{{#if @site.facebook}}<a href="{{facebook_url @site.facebook}}" target="_blank" rel="noopener">Facebook</a>{{/if}}
|
||||
{{#if @site.twitter}}<a href="{{twitter_url @site.twitter}}" target="_blank" rel="noopener">Twitter</a>{{/if}}
|
||||
<a href="https://ghost.org" target="_blank" rel="noopener">Ghost</a>
|
||||
@ -44,11 +44,11 @@
|
||||
{{#if @labs.members}}
|
||||
<div class="subscribe-notification subscribe-success-message">
|
||||
<a class="subscribe-close-button" href="javascript:;"></a>
|
||||
You've successfully subscribed to {{@site.title}}!
|
||||
{{t "You’ve successfully subscribed to"}} {{@site.title}}!
|
||||
</div>
|
||||
<div class="subscribe-notification subscribe-failure-message">
|
||||
<a class="subscribe-close-button" href="javascript:;"></a>
|
||||
Could not sign up! Invalid sign up link.
|
||||
{{t "Could not sign up! Invalid sign up link."}}
|
||||
</div>
|
||||
|
||||
<div id="subscribe" class="subscribe-overlay">
|
||||
@ -59,22 +59,22 @@
|
||||
<img class="subscribe-overlay-logo" src="{{@site.logo}}" alt="{{@site.title}}" />
|
||||
{{/if}}
|
||||
<div class="subscribe-form">
|
||||
<h1 class="subscribe-overlay-title">Subscribe to {{@site.title}}</h1>
|
||||
<p class="subscribe-overlay-description">Stay up to date! Get all the latest & greatest posts delivered straight to your inbox</p>
|
||||
<h1 class="subscribe-overlay-title">{{t "Subscribe to"}} {{@site.title}}</h1>
|
||||
<p class="subscribe-overlay-description">{{t "Stay up to date! Get all the latest & greatest posts delivered straight to your inbox"}}</p>
|
||||
<form data-members-form="subscribe">
|
||||
<div class="form-group">
|
||||
<input class="subscribe-email" data-members-email placeholder="youremail@example.com"
|
||||
autocomplete="false" />
|
||||
<button class="button primary" type="submit">
|
||||
<span class="button-content">Subscribe</span>
|
||||
<span class="button-content">{{t "Subscribe"}}</span>
|
||||
<span class="button-loader">{{> "icons/loader"}}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="message-success">
|
||||
<strong>Great!</strong> Check your inbox and click the link to confirm your subscription.
|
||||
{{t "<strong>Great!</strong> Check your inbox and click the link to confirm your subscription."}}
|
||||
</div>
|
||||
<div class="message-error">
|
||||
Please enter a valid email address!
|
||||
{{t "Please enter a valid email address!"}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@ into the {body} of the default.hbs template --}}
|
||||
<section class="error-message">
|
||||
<h1 class="error-code">{{statusCode}}</h1>
|
||||
<p class="error-description">{{message}}</p>
|
||||
<a class="error-link" href="{{@site.url}}">Go to the front page →</a>
|
||||
<a class="error-link" href="{{@site.url}}">{{t "Go to the front page"}} →</a>
|
||||
</section>
|
||||
|
||||
{{#get "posts" limit="3" include="authors,tags"}}
|
||||
|
@ -38,7 +38,7 @@ You'll notice that we *don't* use any JavaScript, or ghost_head / ghost_foot in
|
||||
<section class="error-message">
|
||||
<h1 class="error-code">{{statusCode}}</h1>
|
||||
<p class="error-description">{{message}}</p>
|
||||
<a class="error-link" href="{{@site.url}}">Go to the front page →</a>
|
||||
<a class="error-link" href="{{@site.url}}">{{t "Go to the front page"}} →</a>
|
||||
</section>
|
||||
|
||||
{{#if errorDetails}}
|
||||
@ -50,8 +50,8 @@ You'll notice that we *don't* use any JavaScript, or ghost_head / ghost_foot in
|
||||
<em class="error-stack-function">{{{rule}}}</em>
|
||||
|
||||
{{#foreach failures}}
|
||||
<p><span class="error-stack-file">Ref: {{ref}}</span></p>
|
||||
<p><span class="error-stack-file">Message: {{message}}</span></p>
|
||||
<p><span class="error-stack-file">{{t "Ref:"}} {{ref}}</span></p>
|
||||
<p><span class="error-stack-file">{{t "Message:"}} {{message}}</span></p>
|
||||
{{/foreach}}
|
||||
</li>
|
||||
{{/foreach}}
|
||||
|
@ -34,7 +34,7 @@
|
||||
{{/if}}
|
||||
|
||||
{{#if @labs.members}}
|
||||
<a class="subscribe-button" href="#subscribe">Subscribe</a>
|
||||
<a class="subscribe-button" href="#subscribe">{{t "Subscribe"}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</nav>
|
||||
|
@ -1,19 +1,19 @@
|
||||
<section class="subscribe-form">
|
||||
<h3 class="subscribe-form-title">Subscribe to {{@site.title}}</h3>
|
||||
<p class="subscribe-form-description">Get the latest posts delivered right to your inbox</p>
|
||||
<h3 class="subscribe-form-title">{{t "Subscribe to"}} {{@site.title}}</h3>
|
||||
<p class="subscribe-form-description">{{t "Get the latest posts delivered right to your inbox"}}</p>
|
||||
<form data-members-form="subscribe">
|
||||
<div class="form-group">
|
||||
<input class="subscribe-email" data-members-email placeholder="youremail@example.com" autocomplete="false" />
|
||||
<button class="button primary" type="submit">
|
||||
<span class="button-content">Subscribe</span>
|
||||
<span class="button-content">{{t "Subscribe"}}</span>
|
||||
<span class="button-loader">{{> "icons/loader"}}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="message-success">
|
||||
<strong>Great!</strong> Check your inbox and click the link to confirm your subscription.
|
||||
{{t "<strong>Great!</strong> Check your inbox and click the link to confirm your subscription."}}
|
||||
</div>
|
||||
<div class="message-error">
|
||||
Please enter a valid email address!
|
||||
{{t "Please enter a valid email address!"}}
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
8
post.hbs
8
post.hbs
@ -50,11 +50,11 @@ into the {body} of the default.hbs template --}}
|
||||
<div class="bio">
|
||||
<h2>{{name}}</h2>
|
||||
<p>{{bio}}</p>
|
||||
<p><a href="{{url}}">More posts</a> by {{name}}.</p>
|
||||
<p>{{t "<a href='{url}'>More posts</a> by {name}"}}</p>
|
||||
</div>
|
||||
{{else}}
|
||||
<h2>{{name}}</h2>
|
||||
<p>Read <a href="{{url}}">more posts</a> by this author.</p>
|
||||
<p>{{t "Read <a href='{url}'>more posts</a> by this author"}}</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
@ -75,7 +75,7 @@ into the {body} of the default.hbs template --}}
|
||||
<h4 class="author-name">{{authors}}</h4>
|
||||
<div class="byline-meta-content">
|
||||
<time class="byline-meta-date" datetime="{{date format="YYYY-MM-DD"}}">{{date format="D MMM YYYY"}}</time>
|
||||
<span class="byline-reading-time"><span class="bull">•</span> {{reading_time}}</span>
|
||||
<span class="byline-reading-time"><span class="bull">•</span> {{reading_time minute=(t "1 min read") minutes=(t "% min read")}}</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -152,7 +152,7 @@ into the {body} of the default.hbs template --}}
|
||||
</ul>
|
||||
</div>
|
||||
<footer class="read-next-card-footer">
|
||||
<a href="{{#../primary_tag}}{{url}}{{/../primary_tag}}">{{plural meta.pagination.total empty='No posts' singular='% post' plural='See all % posts'}}
|
||||
<a href="{{#../primary_tag}}{{url}}{{/../primary_tag}}">{{plural meta.pagination.total empty=(t "No posts") singular=(t "1 post") plural=(t "See all % posts")}}
|
||||
→</a>
|
||||
</footer>
|
||||
</article>
|
||||
|
2
tag.hbs
2
tag.hbs
@ -11,7 +11,7 @@
|
||||
{{#if description}}
|
||||
{{description}}
|
||||
{{else}}
|
||||
A collection of {{plural ../pagination.total empty='posts' singular='% post' plural='% posts'}}
|
||||
{{plural ../pagination.total empty=(t "A collection of posts") singular=(t "A collection of 1 post") plural=(t "A collection of % posts")}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user