Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add internationalisation (i18n) support #103

Closed
wants to merge 4 commits into from
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
4 changes: 2 additions & 2 deletions author.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>

<div class="author-meta">
<span><i class="fa fa-bar-chart-o"></i> {{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}}</span>
<span><i class="fa fa-bar-chart-o"></i> {{plural ../pagination.total empty=(t "No posts") singular=(t "% post") plural=(t "% posts")}}</span>
{{#if location}}<span><i class="fa fa-map-marker"></i>{{location}}</span>{{/if}}
{{#if website}}<span><i class="fa fa-link"></i><a href="{{website}}">{{website}}</a></span>{{/if}}
<span><i class="fa fa-rss-square"></i><a href="{{url}}rss/">{{name}}</a></span>
Expand All @@ -31,4 +31,4 @@
<div class="post-navigation">
{{pagination}}
</div>
</div>
</div>
8 changes: 4 additions & 4 deletions default.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="{{lang}}">
<head>
{{! Document Settings }}
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
Expand Down Expand Up @@ -38,8 +38,8 @@
</div>

<ul class="site-nav">
<li class="site-nav-item"><a class="js-ajax-link" title="{{@blog.title}}" href="{{@blog.url}}">Latest Post</a></li>
<li class="site-nav-item"><a class="js-ajax-link js-show-index" title="{{@blog.title}}" href="{{@blog.url}}">Browse Posts</a></li>
<li class="site-nav-item"><a class="js-ajax-link" title="{{@blog.title}}" href="{{@blog.url}}">{{t "Latest Post"}}</a></li>
<li class="site-nav-item"><a class="js-ajax-link js-show-index" title="{{@blog.title}}" href="{{@blog.url}}">{{t "Browse Posts"}}</a></li>

{{navigation}}

Expand All @@ -63,7 +63,7 @@
<a class="button-square button-jump-top js-jump-top" href="#"><i class="fa fa-angle-up"></i></a>
</div>

<p class="footer-copyright">&copy; {{date format="YYYY"}} / Published with <a href="https://ghost.org">Ghost</a> / <a href="https://github.com/roryg/ghostwriter">Ghostwriter theme</a> By <a href="http://jollygoodthemes.com">JollyGoodThemes</a></p>
<p class="footer-copyright">&copy; {{date format="YYYY"}} / {{{t "Published with {ghostlink}" ghostlink="<a href=\"https://ghost.org\">Ghost</a>"}}} / {{{t "{ghostwriter} theme by {jollygoodthemes}" ghostwriter="<a href=\"https://github.com/roryg/ghostwriter\">Ghostwriter</a>" jollygoodthemes="<a href=\"http://jollygoodthemes.com\">JollyGoodThemes</a>"}}}</p>
</div>
</footer>

Expand Down
18 changes: 18 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Newer Posts": "Newer Posts",
"of": "of",
"Older Posts": "Older Posts",
"Page": "Page",
"Latest Post": "Latest Post",
"Browse Posts": "Browse Posts",
"Published with {ghostlink}": "Published with {ghostlink}",
"{ghostwriter} theme by {jollygoodthemes}": "{ghostwriter} theme by {jollygoodthemes}",
"Tagged:": "Tagged:",
"Posts tagged:": "Posts tagged:",
"Featured": "Featured",
"Published": "Published",
"by": "by",
"No posts": "No posts",
"% post": "% post",
"% posts": "% posts"
}
18 changes: 18 additions & 0 deletions locales/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Newer Posts": "Plus récents",
"of": "sur",
"Older Posts": "Plus anciens",
"Page": "Page",
"Latest Post": "Dernier article",
"Browse Posts": "Parcourir les articles",
"Published with {ghostlink}": "Publié avec {ghostlink}",
"{ghostwriter} theme by {jollygoodthemes}": "Thème {ghostwriter} par {jollygoodthemes}",
"Tagged:": "Étiquetté :",
"Posts tagged:": "Articles étiquettés :",
"Featured": "Épinglé",
"Published": "Publié",
"by": "par",
"No posts": "Pas d’article",
"% post": "% article",
"% posts": "% articles"
}
2 changes: 1 addition & 1 deletion page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{{{content}}}

{{#if tags}}
<p class="post-tags"><span>Tagged:</span> {{tags}}</p>
<p class="post-tags"><span>{{t "Tagged:"}}</span> {{tags}}</p>
{{/if}}
</div>
</article>
Expand Down
6 changes: 3 additions & 3 deletions partials/loop.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<a class="js-ajax-link" title="{{title}} | {{@blog.title}}" href="{{url}}">
<h4 class="post-stub-title">{{title}}</h4>

<time class="post-stub-date" datetime="{{published_at}}">Published {{date format="MMMM Do YYYY"}}</time>
<time class="post-stub-date" datetime="{{published_at}}">{{t "Published"}} {{date published_at timeago="true"}}</time>

{{#if featured}}
<span class="post-stub-tag">Featured</span>
<span class="post-stub-tag">{{t "Featured"}}</span>
{{/if}}
</a>
</li>
{{/foreach}}
{{/foreach}}
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" role="navigation">
{{#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}} {{t "of"}} {{pages}}</span>
{{#if next}}
<a class="older-posts" href="{{page_url next}}">{{t "Older Posts"}} <span aria-hidden="true">&rarr;</span></a>
{{/if}}
</nav>
6 changes: 3 additions & 3 deletions partials/post-content.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<header class="post-header">
<h1 class="post-title">{{title}}</h1>

<p class="post-date">Published <time datetime="{{published_at}}">{{date format="MMMM Do YYYY"}}</time> <strong>by {{author}}</strong></p>
<p class="post-date">{{t "Published"}} <time datetime="{{published_at}}">{{date published_at timeago="true"}}</time> <strong>{{t "by"}} {{author}}</strong></p>
</header>

<div class="post-content clearfix">
Expand All @@ -15,7 +15,7 @@

<footer class="post-footer clearfix">
{{#if tags}}
<p class="post-tags"><span>Tagged:</span> {{tags}}</p>
<p class="post-tags"><span>{{t "Tagged:"}}</span> {{tags}}</p>
{{/if}}

<div class="share">
Expand All @@ -38,4 +38,4 @@
</a>
</div>
</footer>
</article>
</article>
4 changes: 2 additions & 2 deletions tag.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{!< default}}

<div class="container">
<h1 class="page-title">Posts tagged: {{tag.name}}</h1>
<h1 class="page-title">{{t "Posts tagged:"}} {{tag.name}}</h1>

<ol class="post-list">
{{> loop}}
Expand All @@ -10,4 +10,4 @@
<div class="post-navigation">
{{pagination}}
</div>
</div>
</div>