mirror of
https://github.com/GenZmeY/casper-i18n.git
synced 2024-11-14 04:18:04 +00:00
feat: localization
This commit is contained in:
parent
4c298b97cf
commit
cacbd0b01b
@ -25,7 +25,7 @@
|
|||||||
<div class="author-location">{{location}}</div>
|
<div class="author-location">{{location}}</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="author-stats">
|
<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>
|
</div>
|
||||||
{{#if website}}
|
{{#if website}}
|
||||||
<span class="author-social-link"><a href="{{website}}" target="_blank" rel="noopener">Website</a></span>
|
<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">
|
<div class="site-footer-content inner">
|
||||||
<section class="copyright"><a href="{{@site.url}}">{{@site.title}}</a> © {{date format="YYYY"}}</section>
|
<section class="copyright"><a href="{{@site.url}}">{{@site.title}}</a> © {{date format="YYYY"}}</section>
|
||||||
<nav class="site-footer-nav">
|
<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.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}}
|
{{#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>
|
<a href="https://ghost.org" target="_blank" rel="noopener">Ghost</a>
|
||||||
@ -44,11 +44,11 @@
|
|||||||
{{#if @labs.members}}
|
{{#if @labs.members}}
|
||||||
<div class="subscribe-notification subscribe-success-message">
|
<div class="subscribe-notification subscribe-success-message">
|
||||||
<a class="subscribe-close-button" href="javascript:;"></a>
|
<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>
|
||||||
<div class="subscribe-notification subscribe-failure-message">
|
<div class="subscribe-notification subscribe-failure-message">
|
||||||
<a class="subscribe-close-button" href="javascript:;"></a>
|
<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>
|
||||||
|
|
||||||
<div id="subscribe" class="subscribe-overlay">
|
<div id="subscribe" class="subscribe-overlay">
|
||||||
@ -59,22 +59,22 @@
|
|||||||
<img class="subscribe-overlay-logo" src="{{@site.logo}}" alt="{{@site.title}}" />
|
<img class="subscribe-overlay-logo" src="{{@site.logo}}" alt="{{@site.title}}" />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="subscribe-form">
|
<div class="subscribe-form">
|
||||||
<h1 class="subscribe-overlay-title">Subscribe to {{@site.title}}</h1>
|
<h1 class="subscribe-overlay-title">{{t "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>
|
<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">
|
<form data-members-form="subscribe">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="subscribe-email" data-members-email placeholder="youremail@example.com"
|
<input class="subscribe-email" data-members-email placeholder="youremail@example.com"
|
||||||
autocomplete="false" />
|
autocomplete="false" />
|
||||||
<button class="button primary" type="submit">
|
<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>
|
<span class="button-loader">{{> "icons/loader"}}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="message-success">
|
<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>
|
||||||
<div class="message-error">
|
<div class="message-error">
|
||||||
Please enter a valid email address!
|
{{t "Please enter a valid email address!"}}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,7 @@ into the {body} of the default.hbs template --}}
|
|||||||
<section class="error-message">
|
<section class="error-message">
|
||||||
<h1 class="error-code">{{statusCode}}</h1>
|
<h1 class="error-code">{{statusCode}}</h1>
|
||||||
<p class="error-description">{{message}}</p>
|
<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>
|
</section>
|
||||||
|
|
||||||
{{#get "posts" limit="3" include="authors,tags"}}
|
{{#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">
|
<section class="error-message">
|
||||||
<h1 class="error-code">{{statusCode}}</h1>
|
<h1 class="error-code">{{statusCode}}</h1>
|
||||||
<p class="error-description">{{message}}</p>
|
<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>
|
</section>
|
||||||
|
|
||||||
{{#if errorDetails}}
|
{{#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>
|
<em class="error-stack-function">{{{rule}}}</em>
|
||||||
|
|
||||||
{{#foreach failures}}
|
{{#foreach failures}}
|
||||||
<p><span class="error-stack-file">Ref: {{ref}}</span></p>
|
<p><span class="error-stack-file">{{t "Ref:"}} {{ref}}</span></p>
|
||||||
<p><span class="error-stack-file">Message: {{message}}</span></p>
|
<p><span class="error-stack-file">{{t "Message:"}} {{message}}</span></p>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</li>
|
</li>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if @labs.members}}
|
{{#if @labs.members}}
|
||||||
<a class="subscribe-button" href="#subscribe">Subscribe</a>
|
<a class="subscribe-button" href="#subscribe">{{t "Subscribe"}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<section class="subscribe-form">
|
<section class="subscribe-form">
|
||||||
<h3 class="subscribe-form-title">Subscribe to {{@site.title}}</h3>
|
<h3 class="subscribe-form-title">{{t "Subscribe to"}} {{@site.title}}</h3>
|
||||||
<p class="subscribe-form-description">Get the latest posts delivered right to your inbox</p>
|
<p class="subscribe-form-description">{{t "Get the latest posts delivered right to your inbox"}}</p>
|
||||||
<form data-members-form="subscribe">
|
<form data-members-form="subscribe">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="subscribe-email" data-members-email placeholder="youremail@example.com" autocomplete="false" />
|
<input class="subscribe-email" data-members-email placeholder="youremail@example.com" autocomplete="false" />
|
||||||
<button class="button primary" type="submit">
|
<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>
|
<span class="button-loader">{{> "icons/loader"}}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="message-success">
|
<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>
|
||||||
<div class="message-error">
|
<div class="message-error">
|
||||||
Please enter a valid email address!
|
{{t "Please enter a valid email address!"}}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
8
post.hbs
8
post.hbs
@ -50,11 +50,11 @@ into the {body} of the default.hbs template --}}
|
|||||||
<div class="bio">
|
<div class="bio">
|
||||||
<h2>{{name}}</h2>
|
<h2>{{name}}</h2>
|
||||||
<p>{{bio}}</p>
|
<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>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<h2>{{name}}</h2>
|
<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}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -75,7 +75,7 @@ into the {body} of the default.hbs template --}}
|
|||||||
<h4 class="author-name">{{authors}}</h4>
|
<h4 class="author-name">{{authors}}</h4>
|
||||||
<div class="byline-meta-content">
|
<div class="byline-meta-content">
|
||||||
<time class="byline-meta-date" datetime="{{date format="YYYY-MM-DD"}}">{{date format="D MMM YYYY"}}</time>
|
<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>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ into the {body} of the default.hbs template --}}
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<footer class="read-next-card-footer">
|
<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>
|
→</a>
|
||||||
</footer>
|
</footer>
|
||||||
</article>
|
</article>
|
||||||
|
2
tag.hbs
2
tag.hbs
@ -11,7 +11,7 @@
|
|||||||
{{#if description}}
|
{{#if description}}
|
||||||
{{description}}
|
{{description}}
|
||||||
{{else}}
|
{{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}}
|
{{/if}}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user